◆ New — Strategy Validator, Code Fixer & Prop Compliance Checker are live. Try one free →
Home / NinjaScript Validator
New · the correctness layer for NinjaTrader

NinjaScript Validator

A NinjaTrader backtest that shines and then behaves differently live is usually repainting — a signal that flickers intrabar under Calculate.OnEachTick. Paste your NinjaScript strategyand we flag it: intrabar repaint, future-bar access via CurrentBar + N, unsynced multi-series higher timeframes, Historical-vs-Realtime divergence, and missing stops — each with the exact fix. Correctness, not profitability.

Deterministic static analysis — runs on the server, code isn't stored. Correctness only, not profitability.

What it catches
Intrabar repaint

Calculate.OnEachTick entries with no IsFirstTickOfBar / bar-close guard — signals that fire and un-fire before the bar closes.

Future-bar access

Absolute-index reads ahead of the current bar (Bars.GetClose(CurrentBar + N)) and negative barsAgo indices.

Multi-series HTF sync

AddDataSeries higher-timeframe reads before the secondary bar has closed — NinjaScript's repainting request.security.

Historical vs Realtime

Trading logic that branches on State.Historical / State.Realtime, so the backtest path differs from live.

Risk controls

Entries with no SetStopLoss / ExitLong…Stop, and whether a profit target and position sizing are present.

Hygiene

Empty catch blocks that swallow exceptions and quietly corrupt a backtest.

Trade other platforms too? Check Pine Script, Python, or MetaTrader (MQL) — same correctness engine, every platform.
FAQ
How do I check a NinjaScript strategy for repainting or look-ahead bias?

Paste your NinjaTrader 8 strategy here. The validator statically scans for the patterns that make a backtest diverge from live: Calculate.OnEachTick entries without an IsFirstTickOfBar / bar-close guard (intrabar repaint), absolute future-bar access via Bars.GetClose(CurrentBar + N), unsynced multi-series higher-timeframe reads, and Historical-vs-Realtime branching. It's deterministic and doesn't run your code.

Why does Calculate.OnEachTick cause repainting?

With OnEachTick, OnBarUpdate runs on every tick, so an entry condition built from the still-forming bar's High/Low/Close can become true and then false before the bar closes. The backtest sees only completed bar data, so it can't reproduce that intrabar flicker — the strategy behaves differently live. Gate entries with IsFirstTickOfBar, or use Calculate.OnBarClose.

Does a high score mean my strategy is profitable?

No. The score measures code CORRECTNESS — whether the strategy could have known what it acts on and whether it has basic risk controls. It says nothing about profitability, and nothing here is a prediction or trading advice.

Do you run or store my NinjaScript?

No. The analysis is deterministic static pattern-matching that runs on the server and returns the report — your code is not compiled, not executed, and not stored.

Catch the bug that compiles.Run auditGet Pro