Search
Trading Tools
    Menu Close
    Back to all

    Create a NinjaTrader Indicator with AI

    You do not always need a detailed software specification to create a useful NinjaTrader indicator with AI. For straightforward projects, a short description of what the indicator should do can be enough to get started.

    In this three-minute tutorial, we use Xen AI for NinjaTrader to create a custom Session High and Low indicator from a single plain-English prompt.

    Watch a NinjaTrader Indicator Built from a Simple Prompt

    The demonstration starts with one short request describing the indicator behaviour, rather than an image, existing source code or detailed technical specification.

    Watch the NinjaTrader AI indicator tutorial on YouTube

    Describe the Indicator in Plain English

    The request used in the video was deliberately simple:

    Create an indicator that plots the current trading session high and low as horizontal lines. Reset both levels at the start of each new session. Add configurable inputs for line colour and width.

    This tells Xen what should be calculated, how the values should behave between trading sessions and which settings the trader should be able to configure. Xen then converts those requirements into the NinjaScript needed to create the indicator for NinjaTrader.

    From Trading Requirement to NinjaScript

    A trader does not necessarily need to describe the C# implementation, NinjaScript classes or drawing methods required by the platform. The important part is clearly explaining the behaviour expected from the trading tool. In this example, the indicator tracks the highest and lowest prices of the active trading session, displays those levels on the chart and starts calculating new values when the next session begins.

    Start Simple and Add Features Later

    For many NinjaTrader projects, starting with the core requirement is preferable to trying to describe every possible feature in the first request. Once the initial indicator is working, additional requirements can be added through follow-up requests. For example, the session times, line styles, labels, alerts or other chart behaviour could be introduced later without rebuilding the original project from scratch.

    Different Ways to Build NinjaTrader Indicators with AI

    Our previous demonstration showed how Xen can use an image as a visual reference when creating a custom NinjaTrader indicator. This example demonstrates a different workflow: starting entirely from written requirements. Xen AI for NinjaTrader can work with plain-English instructions, images and existing NinjaScript projects, allowing the starting point to match the information already available to the trader.

    Test AI-Generated Indicators

    AI can accelerate NinjaScript development, but generated indicators still need to be reviewed and tested. Confirm that session handling, plotted values and configurable settings behave correctly across different instruments and chart configurations. Successful compilation confirms that the code is technically valid, but the indicator behaviour should still be verified inside NinjaTrader before it is relied upon for trading decisions.

    Build NinjaTrader Indicators with Xen AI

    Xen AI for NinjaTrader provides a dedicated development workspace for creating indicators and automated strategies, modifying existing NinjaScript, repairing code and continuing projects through follow-up requests.

    For simple projects, getting started can be as straightforward as describing what you want the indicator to do.

    Open Xen AI for NinjaTrader