NinjaTrader 8 Volatility-Spike Strategy Suite
Ongoing upgrades to a family of NT8 futures strategies built around return-volatility spikes, including an ATM-managed variant, a news blackout, a two-stage level-entry bot and a Renko reversal strategy.
The problem
A repeat client ran several NQ/MNQ strategies in NinjaTrader 8 and kept asking for new filters, order-handling modes and fixes. Each change had to fit into the existing code without breaking the live setups.
What I built
- Spike indicator: a bar’s return divided by the standard deviation of the previous N returns. A signal fires when this ratio passes a threshold. A reverse mode fades the spike instead of following it.
- Dual-entry strategy: each signal opens a fixed-target leg and a trailing leg, each with its own size.
- Trailing modes: NT8’s built-in trail, activate-then-distance, or activate-then-pivot (trails behind the recent swing low or high).
- ATM variant: entries go through
AtmStrategyCreatewith a two-phase state machine that tracks the entry order, then the ATM position. An optional “human mode” adds a random delay of 0.5 to 3 seconds before each order. - News blackout: an economic calendar feed is downloaded every 4 hours. High-impact USD events block entries for a window before and after the release, and can optionally close open positions.
- Risk controls: daily loss, profit and trade-count limits that reset each session. Up to three trading windows. Contracts are added after a losing streak, up to a cap.
- EMA-angle filter: requires the EMA to have moved a minimum number of ticks over N bars before an entry.
- Two-stage level-entry bot on Renko-style bars:
- enters when price reaches a level, then again when it crosses back
- each stage has its own size, target and stop
- a bar-time filter, a higher-timeframe master EMA with the same angle rule, and ADX and EMA filters
- Renko reversal strategy: a Heikin-Ashi price series feeding an ATR trend switch, reverse-on-signal exits and an optional candle trailing stop.
- Email alerts over SMTP for connect/disconnect, entries and exits.
Details
- Timer callbacks for the delayed “human” orders are marshalled back into the NinjaScript thread with
TriggerCustomEvent, so NT8’s state is never touched from a worker thread. - The losing-streak counter skips historical trades when the strategy goes live, so a backtest’s losses never inflate live size.
- The Renko reversal strategy refuses to trade outside backtest or playback. It was built as a research tool, and the guard makes that explicit.