AI Strategy Builder

<< Click to Display Table of Contents >>

Navigation:  Operations > Strategy Builder >

AI Strategy Builder

Previous page Return to chapter overview Next page

AI Strategy Builder turns your trading idea into a compiled, backtested NinjaScript strategy. Describe your entries, exits, and risk logic in plain English. If AI Strategy Builder needs more detail, it asks follow-up questions. It confirms it understands your strategy, then creates the strategy, compiles it, and runs a backtest in the same window. To change a detail, keep chatting instead of starting over.

 

Note: AI Strategy Builder is currently available in English only.

 

Open AI Strategy Builder

1.In the Control Center, go to the New menu, then select Strategy Builder.

2.Wait for the compile check. NinjaTrader checks your NinjaScript for compile errors before it opens AI Strategy Builder. If errors appear, fix them, then try again. For help, see How to Troubleshoot Compile Errors.

 

AIStrategyBuilder3

 

3.In the Select which product window, select AI Strategy Builder, then select Continue.

 

AIStrategyBuilder5

 

The AI Strategy Builder window opens with only the chat.

 

AIStrategyBuilder6

 

Create a strategy

1.Enter your strategy in the chat, with as much detail as you can. For example: “Go long when the 20 EMA crosses above the 50 EMA and RSI is below 30. Exit when RSI crosses above 50 or after 10 bars. Include a 20-tick profit target and 40-tick stop loss, 1 contract at a time.”

2.Answer any follow-up questions. AI Strategy Builder asks about your conditions and parameters when it needs more information.

3.Review the recap. AI Strategy Builder summarizes your strategy and lists any default values it applies for details you left out, such as the instrument, time frame, and when to evaluate signals.

4.Reply yes, confirm, or proceed to approve the recap. To change something, describe the change.

5.Wait while AI Strategy Builder creates and compiles the strategy. If compile errors occur, it tries to fix them, up to 3 times.

6.Review the backtest. When the strategy compiles, the window expands and runs a backtest.

 

Review and adjust a backtest

When the backtest runs, the window expands to show the results in the Strategy Analyzer, along with a Settings panel for the strategy and the backtest. The chat stays in the window.

 

AIStrategyBuilder8

 

After the backtest runs, you can:

 

•Change the strategy parameters in the Settings panel, then select Run to backtest again

•Adjust the backtest settings, such as the data series and time frame, then select Run

•Keep chatting to change the strategy, such as its conditions, stops, or targets

 

For more information about backtest results, see Strategy Analyzer.

 

Strategy Analyzer menu

To open the menu, right-click in the Strategy Analyzer. The menu has these items:

 

AIStrategyBuilder9

 

NinjaScript Output

Opens the NinjaScript Output window. See Output Window.

Show Tabs

Shows or hides the Strategy Analyzer tabs

Show Log

Shows or hides the log

Properties

Opens the Strategy Analyzer Properties window. See Strategy Analyzer Properties.

 

Chat controls

Send

Sends your message. You can also press Enter.

Thumbs up and thumbs down

Tell NinjaTrader whether a response was helpful.

More options (under a response)

Select View Code in Editor to open the generated code in the NinjaScript Editor.

More options (in the chat header)

Select Check My AI Usage to see your current token usage and limits, or Help Guide to open this topic.

 

AIStrategyBuilder4

 

Usage limits

AI Strategy Builder has hourly and daily token limits. To see your usage, select More options in the chat header, then select Check My AI Usage.

 

AIStrategyBuilder7

 

If you reach a limit, new requests stay unavailable until the limit resets. Wait and try again later.

 

Unsupported indicators or external resources

If a generated strategy uses an indicator, library, or external data resource that NinjaTrader doesn’t have, AI Strategy Builder inserts a placeholder in the generated code where the unsupported reference is needed. You can then add or connect the missing code, indicator, or resource yourself.

 

Prompting tips

For the best results:

 

•Be explicit with entry and exit conditions

•Specify the default order quantity

•Define indicators and parameters clearly

•Include risk management, such as a stop loss and profit target

•Avoid vague terms like “strong trend”

 

Best uses

•Prototyping strategies quickly

•Learning NinjaScript structure

•Iterating on trading ideas

•Testing variations of existing strategies

 

Things to know

•AI Strategy Builder helps you develop your own strategies. It doesn’t provide trading advice or recommendations, and all strategy inputs come from you

•A generated strategy is a starting point, not a finished system

•Review the code and validate the results before you trade live

•Complex strategies can take several iterations

•Indicator support varies