NinjaTrader 8 Pivot Points Strategy: free code and honest test
A classic floor-pivot reversal for NinjaTrader 8, tested on five years of MNQ data, with the results as they came out.
The idea
Floor pivots turn yesterday's high, low and close into support and resistance levels for today. The strategy fades the first touch of the first support (S1) or resistance (R1) back toward the pivot.
In plain English
Each morning the strategy turns yesterday's high, low and close into a set of levels. If price pokes through the first support or resistance level and then closes back inside it, the strategy bets on a move back to the middle level (the pivot). It takes at most one trade a day. When a trade works it usually pays a small, quick amount; when it fails it takes the full stop.
The exact rules
- Chart: MNQ, 5-minute bars, default CME US Index Futures ETH trading hours.
- Pivot P = (previous regular-session high + low + close) / 3. S1 = 2P - high, R1 = 2P - low.
- Buy when a bar trades down to S1 or below but closes back above it; sell short when a bar trades up to R1 or above but closes back below it.
- Target = P (at least 4 ticks away). Stop = 2 x ATR(14). One trade a day, flat from 15:55.
Test results (MNQ, 5 years)
Result: close to zero. It made $2,351 on 688 trades (profit factor 1.05), about $470 a year. Longs made $3,333 and shorts lost $982. Without its five best trades it lost $1,405, and with three ticks of slippage it made only $178. 4 of 6 calendar years were positive; 2026 lost $2,358. Pivot levels are widely watched, but this simple way of trading them did not show a usable edge.
| With costs | Costs ignored | |
|---|---|---|
| Net profit | $2,351 | $3,302 |
| Number of trades | 688 | 688 |
| Winning trades | 41.7% | 41.9% |
| Profit factor | 1.05 | 1.07 |
| Average trade | $3 | $5 |
| Worst drawdown | -$3,913 | |
| Net without its 5 best trades | -$1,405 |
Results are in US dollars for one MNQ contract. "Costs ignored" is shown only so you can see how much costs matter; it is not what you would have received.
Equity curve
The chart is the sum of every simulated trade in order. It shows what the totals above hide: how long the account spent below its previous high (up to 260 trading days at worst), and how much of the result arrived in a short stretch. Among all 25 strategies in our free pack, this one ranks #7 for net profit and #5 for profit factor after costs. The full comparison is on the strategy hub page.
Three real trades, step by step
These come straight from the simulation, so you can check what a trade looks like in practice. NinjaTrader stamps each 5-minute bar with its closing time, so times below are bar-close times in Eastern, and the end-of-day exit shows as 15:55 or 16:00. The average winning trade made $166 and the average losing trade lost $113.
- Best trade of the five years: on March 4, 2025 at 10:35 Eastern it bought MNQ at 20159.50 and was out at 20637.83 at 15:05, a move of +478.33 points, which is +$956 after costs on one contract.
- Worst trade: on April 7, 2025 at 10:20 Eastern it sold short MNQ at 17955.75 and was stopped out at 18324.56 within the same 5-minute bar, a move of -368.81 points, which is -$739 after costs on one contract.
- A typical (median) trade: on March 31, 2023 at 09:45 Eastern it sold short MNQ at 13122.25 and was out at 13153.32 at 09:55, a move of -31.07 points, which is -$63 after costs on one contract.
When it made and lost money
Slicing trades by the hour they were entered and the day of the week. Entry hours are Eastern time. Its best entry hour by net was 09:35 (+$3,027) and its worst was 13:00 (-$1,667); its best weekday was Thursday (+$4,780) and its worst was Wednesday (-$2,288). With a few hundred or a few thousand trades split this many ways, the groups are small, so treat these as observations to study, not as rules to filter your trading by.
| Entry hour (Eastern) | Trades | Winners | Net | Avg per trade |
|---|---|---|---|---|
| 09:35 to 09:59 | 238 | 42% | $3,027 | $13 |
| 10:00 to 10:59 | 230 | 40% | -$797 | -$3 |
| 11:00 to 11:59 | 93 | 42% | -$108 | -$1 |
| 12:00 to 12:59 | 39 | 46% | $675 | $17 |
| 13:00 to 13:59 | 40 | 30% | -$1,667 | -$42 |
| 14:00 to 14:59 | 37 | 49% | $528 | $14 |
| 15:00 to 15:59 | 11 | 82% | $693 | $63 |
| Weekday | Trades | Winners | Net | Avg per trade |
|---|---|---|---|---|
| Monday | 65 | 42% | $556 | $9 |
| Tuesday | 157 | 45% | $1,568 | $10 |
| Wednesday | 170 | 35% | -$2,288 | -$13 |
| Thursday | 146 | 50% | $4,780 | $33 |
| Friday | 150 | 37% | -$2,265 | -$15 |
Long trades versus short trades
Longs: 305 trades, $3,333 net, 45% winners. Shorts: 383 trades, -$982 net, 39% winners. MNQ rose over much of this period, so a strategy that makes its money on the long side may only be riding the market.
Year by year
| Year | Net (with costs) | Trades |
|---|---|---|
| 2021 (from October) | $79 | 37 |
| 2022 | -$453 | 145 |
| 2023 | $888 | 168 |
| 2024 | $3,083 | 126 |
| 2025 | $1,113 | 99 |
| 2026 (to October) | -$2,358 | 113 |
Cost stress test
| Cost assumption | Net | Profit factor |
|---|---|---|
| Base costs: $0.50 per side + 1 tick slippage | $2,351 | 1.05 |
| Double commission ($1.00 per side) + 2 ticks slippage | $954 | 1.02 |
| $1.00 per side + 3 ticks slippage | $178 | 1.00 |
Real fills are often worse than a simulation, so we also ran the same trades with higher commission and more slippage. A strategy whose result disappears here is too thin to trade.
How we tested. This is our own simulation, run in Python on NinjaTrader 1-minute MNQ bars from October 2021 to October 2026 (1,466 trading days), built into 5-minute bars. Signals are read at the close of a bar and filled at the open of the next bar. Costs: $0.50 commission per side plus one tick of slippage on every market or stop fill, 1 contract, regular trading hours only, everything flat by 15:55 Eastern. Targets fill only when price trades one tick through them, and if one bar touches both the stop and the target the stop counts first. The settings are the textbook defaults, chosen before the test and never optimised. The table above is not a NinjaTrader Strategy Analyzer run, so your own backtest will differ somewhat. As a check, we ran six of these strategies (EMA Cross, Keltner, opening range breakout, Fibonacci, Renko-style and Ichimoku) in Strategy Analyzer on MNQ 03-26, 5-minute bars, 5 January to 10 March 2026, with no commission or slippage, and compared them with our simulation over the same dates: trade counts were within 5% and win rates within about 3 percentage points. That check covers those six strategies over about ten weeks, not the whole pack or the whole five years. Run your own before you trust anything.
How to use it in NinjaTrader 8
- Download the
.csfile above and save it toDocuments\NinjaTrader 8\bin\Custom\Strategies. - In NinjaTrader choose New → NinjaScript Editor, then press F5 to compile. Compiling reloads all your NinjaScript, so do it when you have no open position and nothing running live.
- To backtest, open New → Strategy Analyzer, choose VortexPivotReversal, set the instrument to MNQ and a 5 Minute data series, pick a date range and run it.
- To run it on a chart, right-click the chart, choose Strategies, add VortexPivotReversal, set the account and order quantity, and tick Enabled. Start on a simulated account.
- Backtest on a single contract month such as MNQ 03-26, or on a correctly merged series. In our testing a merged
MNQ ##-##series returned no trades in Strategy Analyzer, while a single contract worked. - Times in the settings use your chart's time zone. The defaults assume US Eastern time, so change them if your PC clock is in another zone.
- Use the default CME US Index Futures ETH trading hours. When you backtest across a contract roll, use a back-adjusted merged contract. Our test skipped the day after each roll.
Settings
| ATR period / stop multiple | 14 / 2.0 |
|---|---|
| Trade from / Last entry / Flat by | 093500 / 153000 / 155500 |
Questions
Is this strategy profitable?
See the results above, which are simulated, include costs and are shown exactly as they came out. A simulation does not predict the future, and we do not claim this strategy makes money.
Can I use it on a prop firm account?
Check your firm's rules first. Many prop firms ban automated trading, and breaking that rule can cost you your account. We do not know your firm's current rules.
Why do the results not match my NinjaTrader backtest?
Our results come from our own simulation with the fill rules stated above, not from Strategy Analyzer. Fill assumptions, data and time zones differ, so results will differ. Always run your own test.
Can I change it?
Yes. It is plain NinjaScript with the source included, so you can edit it or learn from it. Changing the settings to fit past data usually makes the past look better and the future no better, so be careful.
How much does it cost?
Nothing. It is free. If you like free tools, see the free Drawdown Panel and the Monte Carlo calculator.
← All free NinjaTrader 8 strategies · Risk & disclosures