Search
Trading Tools
    Menu Close
    Back to all

    Create a NinjaTrader Indicator with AI

    You do not need a detailed software specification to start building a NinjaTrader indicator with AI. For a straightforward project, a clear description of what the indicator should calculate and display can be enough 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.

    Try Xen AI for NinjaTrader

    Watch a NinjaTrader Indicator Built from a Simple Prompt

    The demonstration starts with one short request describing the required indicator behaviour. There is no existing source code, image or detailed technical specification.

    Watch the NinjaTrader AI indicator tutorial on YouTube

    Describe the Indicator in Plain English

    The request used in the video is 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.

    The prompt defines what should be calculated, when the values should reset and which settings should be configurable. Xen then uses those requirements to generate the NinjaScript implementation.

    The trader does not need to specify the C# classes, NinjaScript lifecycle methods or drawing APIs required to implement the indicator. What matters is describing the expected behaviour clearly enough for Xen to understand the requirement.

    In this example, the indicator needs to track the highest and lowest prices during the active trading session, display those levels on the chart and begin calculating new levels when the next session starts. Those are useful functional requirements even though they do not describe how the code should be written.

    Start with the Core Indicator and Add Features Later

    For many NinjaTrader projects, it is better to get the core behaviour working before adding every optional feature. Once the initial Session High and Low indicator has been created and tested, the same project can be extended through follow-up requests.

    You might later add configurable session times, different line styles, price labels, alerts or additional chart behaviour. This incremental approach also makes it easier to test each change before adding the next requirement.

    A written prompt is only one way to start a Xen project. Indicators can also be created from a visual reference, while existing NinjaScript can be loaded when the task is to review or modify code that already exists.

    Test the Generated NinjaTrader Indicator

    AI-generated NinjaScript still needs to be checked and tested. For this indicator, confirm that the session high and low reset at the correct time, the plotted values match the chart data and the configurable settings behave as expected.

    Successful compilation confirms that the code is technically valid, but it does not confirm that the indicator behaves correctly in every situation. Test it with the instruments, sessions and chart configurations you intend to use before relying on its output.

    Build NinjaTrader Indicators with Xen AI

    Xen AI for NinjaTrader provides a development workspace for creating indicators and strategies, modifying existing NinjaScript and continuing development through follow-up requests. For a simple indicator, the starting point can be as straightforward as describing what you want it to calculate and display.

    Open Xen AI for NinjaTrader