Grid Autostrategy¶
v.3.1.0.0 Built on Strategy Core

Overview¶
Places a grid of orders when the price crosses its mean in a market without a trend - the two averages close together and the price slope flat - aiming at a return to the mean.
How it trades¶
- A long when the close crosses above EMA period 1, the two EMAs are at most EMA difference points apart and the slope stays within ±Slope limit degrees; a short the mirror.
- The first order is a limit at the signal bar's close; further orders come from the core's Scaling group.
Parameters¶
| Parameter | Default | What it does |
|---|---|---|
| EMA period 1 | 200 | The slow average: the close crossing it is the signal; its period is also the slope's length. |
| EMA period 2 | 50 | The fast average, compared with the slow one. |
| EMA difference (points) | 100 | The two averages at most this far apart - no trend between them. |
| Slope limit (degrees) | 35 | The price slope over EMA period 1 bars at most this steep, up or down. |
Core settings¶
Order handling, position size, stops and targets, trade management, trading hours, account limits and the ML Engine are core settings - the same in every strategy. Hover a group or a core term for a short explanation.
Strategy Core General & Orders Quantity & Scaling Stop loss & Profit target Trade management Sessions & time Money & News ML Engine Log & Report
Core defaults¶
This strategy starts with these core settings; change any of them in its settings.
| Group | Setting | Default |
|---|---|---|
| NinjaTrader | Calculate | On bar close |
| General properties | Direction | Long only |
| Orders | Entry type | Limit |
| Orders | Entry price | Close |
| Orders | Entry lifetime (bars) | 1 |
| Quantity | Quantity | 1 |
| General properties | Scaling | On |
| Scaling | Type | Single position |
| Scaling | Placement | Resting |
| Scaling | Direction | Drop |
| Scaling | Count | 4 |
| Scaling | Mode | Ticks |
| Scaling | Trigger (ticks) | 30 |
| Scaling | Step mode | Same |
| Scaling | Protection after add | Recalculate |
| Stop loss | Mode | Percent |
| Stop loss | Percent (%) | 1 |
| Profit target | Mode | Percent |
| Profit target | Percent (%) | 0.5 |
| General properties | Subsessions | On |
| Subsessions | S1 Enable | On |
| Subsessions | S1 Start | 01:00 |
| Subsessions | S1 End | 13:00 |
| Subsessions | S2 Enable | On |
| Subsessions | S2 Start | 13:00 |
| Subsessions | S2 End | 17:00 |
| NinjaTrader | Exit on session close | On |
| NinjaTrader | Exit on session close (s) | 30 |
| General properties | Money management | On |
| Money management | Enable Daily Profit | On |
| Money management | Enable Daily Loss | On |
| Money management | Daily profit | 1000 |
| Money management | Daily loss | 1000 |
| ROI (off) | Mode | Percent |
| ROI (off) | Period 1 (bars) | 15 |
| ROI (off) | Period 2 (bars) | 30 |
| ROI (off) | Period 3 (bars) | 45 |
| ROI (off) | Value 1 (%) | 0.2 |
| ROI (off) | Value 2 (%) | 0.1 |
| ROI (off) | Value 3 (%) | 0.05 |
The grid itself - how many orders, how far apart - is set in the core's Scaling group; see Core defaults.
Version history¶
v.3.1.0.0 - October 2026
- Changed: the signal follows NinjaTrader's Calculate setting - On bar close by default; On each tick reads the forming bar.
Earlier versions
v.3.0.0.0 - October 2026
- Rebuilt on the Strategy Core: orders, sizing, stops and targets, trade management, sessions, limits and the ML Engine are core settings.
v.2.1.0.0 - May 25, 2026
- Direction forecast: added COT (Commitment of Traders) features.
v.2.0.0.0 - Mar 9, 2026
- ML Engine filter feature added.
v.1.2.0.1 - Oct 26, 2025
- Trading hours and days logic updated — if all sessions are disabled, the strategy now runs without time restrictions instead of stopping trading.
v.1.2.0.0 - May 21, 2025
- Added detailed comments to strategy and indicator.
- Added ROI function for trade exit.
v.1.0.0.4 - Feb 23, 2025
- Added detailed commenting to all code to better understand how the code works.
v.1.0.0.3 - Aug 1, 2024
- New Stop Loss and Profit functions are added.
- Stop Loss and Profit order calculation type is added (ticks, pips, percent, currency).
- Created a special function of raising a position after breaking the connection with the strategy, which takes into account how many grid orders have already been executed and restores grid orders that have not been executed yet.
- Created special order names used in special events of closing a position, closing due to risk, or closing a position due to the end of the session.
- Updated manual.
v.1.0.0.2 - Nov 12, 2023
- Improved trading session time.