Building Strategies
Select Build Strategy when you want Xen to create a new automated NinjaTrader 8 Strategy and no existing source file is being modified or converted.
Describe the trading rules from the perspective of behaviour rather than code. Xen needs to know when entries occur, how a position is exited, whether long and short trading are both allowed, and what risk controls are required. Features that are not requested are not added automatically, so include a stop loss, profit target, trailing stop, session filter or position-sizing method only when it belongs in the design.
Build a NinjaTrader Strategy with AI
Watch this two-minute video to see how Xen turns a trading idea into a NinjaScript strategy.
Tip: Set the video quality to HD (1080p) for the best viewing experience.
Generate a baseline
Begin with the smallest version that proves the entry and exit logic. A simple baseline is easier to compile and backtest than a complete system containing every planned feature. If the request is complex, allow the Prompt Builder to create a staged Build Plan.
When the response is complete, Xen presents an overview, one complete C# source file and implementation notes. The action bar at the end of the response can copy the source, download the .cs file, download a NinjaTrader Add-On ZIP, run Build Check or verify the requirements. The Add-On download requires the current source to pass Build Check.
Check and compile
Run Build Check before moving the file to NinjaTrader. This checks the source against the NinjaTrader assemblies installed on the Xen server and detects ordinary C# errors as well as selected NinjaScript lifecycle mistakes.
A passed Build Check is not the same as execution inside NinjaTrader. Import or paste the source into the NinjaScript Editor, compile all NinjaScript, and review the NinjaTrader Log for errors raised while the Strategy changes state. After compilation, use Strategy Analyzer and simulation to confirm that signals, position handling and protective orders behave as intended.
Continue the project
Return to the same conversation for focused refinements. State the required change and avoid asking Xen to redesign working behaviour that should remain intact. Each complete source revision is saved in History when the generated C# changes. Use Verify requirements after meaningful revisions. It compares the latest source with the explicit requirements from the conversation and separates implemented behaviour, missing behaviour and tests that still require NinjaTrader.
Backtest analysis is separate from the build project. Choose Analyse Backtest from the task panel and upload a Strategy Analyzer Summary CSV when you want Xen to review test results. The analysis does not use the current project's source code.
Simulation before live use
A Strategy can compile successfully and still contain unsuitable order handling, unrealistic assumptions or trading logic that behaves differently in real time. Test with realistic costs and use a simulation account before considering live deployment.