Skip to content

Build Check and Repair

Every completed generated code response includes Build check in its action bar. Xen sends the latest complete C# file to an isolated server-side compiler configured with installed NinjaTrader assemblies.

Build Check is intended to catch ordinary C# compiler problems and selected NinjaScript lifecycle mistakes before you move the file into NinjaTrader. The generated assembly is never executed.

Understanding a passed check

A passed result means the server compiler found no supported build errors. It does not prove that NinjaTrader will load the script, that OnStateChange will complete, or that the trading behaviour is correct.

The report therefore reminds you to compile and test in NinjaTrader. A successful Strategy report also displays Analyse backtest results, which prepares the workspace for a Strategy Analyzer Summary CSV after you have run a test.

Understanding build errors

When compilation fails, Xen groups repeated diagnostics into unique issues and shows the first relevant source locations. The badge reports both the total number of compiler errors and the number of unique issues, reducing noise from the same missing type or attribute appearing on several lines.

Choose Repair build errors to prepare a focused request containing the diagnostics and latest source. The repair runs through the normal AI workflow and consumes credit. Run Build Check again after the revised file is returned.

After two unsuccessful repair attempts, Xen can offer Retry repair with Codex 5.3. The switch is explicit and is not made without your action.

Final compilation

Always compile the source in the same NinjaTrader installation where it will be used. Local Add-Ons, custom Indicators and NinjaTrader versions can create dependencies that are not present on the Xen server.

Review the NinjaTrader Log after compilation and when enabling a Strategy. Runtime errors must be reported through Existing Strategy or Existing Indicator with the complete source and exact Log message.