Overview

Build custom indicators, strategies, and add-ons for the NinjaTrader 8 desktop platform with C#.

View as Markdown

NinjaScript is NinjaTrader’s C# programming framework for extending the NinjaTrader 8 desktop platform. You use it to write custom indicators, automated strategies, drawing tools, and full add-ons that run inside NinjaTrader 8 alongside the built-in tools — driven by the same market data, charting, and order-execution engine the platform uses itself.

NinjaScript runs only in the NinjaTrader 8 desktop application (Windows). It is not used for the NinjaTrader web trader. If you want to build indicators or drawing tools for the web trader, see Web Trader instead.

This product was previously labeled “Desktop SDK.” It’s the same NinjaScript framework — renamed here because NinjaScript is the term developers already know.

What You Can Build

  • Indicators — plot studies and signals on charts, from a simple moving average to advanced custom drawing and multi-threaded calculations.
  • Strategies — automated, backtestable trading systems that submit and manage orders, with optimization and walk-forward analysis.
  • AddOns — custom windows, tabs, and tools that integrate with the platform’s accounts, instruments, and workspaces.
  • Drawing tools — interactive chart objects beyond the built-in set.
  • Custom Bars types — define how raw data is aggregated into bars.
  • Chart styles — control how bars and series are rendered, including custom rendering with SharpDX.
  • Market Analyzer & SuperDOM columns — add your own columns to the grid and order-entry tools.
  • Optimizers, optimization fitness, and performance metrics — extend backtesting with custom logic and statistics.

How It Works

NinjaScript is written in C#. You create and compile it in the built-in NinjaScript Editor, or develop and debug in an external IDE such as Visual Studio. If you’d rather not write code by hand, the Strategy Builder and wizards generate NinjaScript for you. Once compiled, your code runs inside NinjaTrader 8 and reacts to data and events through the NinjaScript lifecycle.

Because it runs in-process with the platform, NinjaScript has direct access to live and historical data, the charting and rendering pipeline, accounts and connections, and order submission — the building blocks documented throughout this product’s Guides and References.

Where to Start

New to NinjaScript? Work through these in the Guides section of the sidebar:

  • Introduction — orientation and prerequisites.
  • NinjaScript Editor Overview — the editor, compiling, IntelliPrompt, and debugging.
  • NinjaScript Best Practices — conventions that keep your code correct and performant.
  • Developing Indicators and Developing Strategies — step-by-step builds, beginner to advanced (under Educational Resources).
  • AddOn Development Overview — for building custom windows and platform integrations.

When you need exact class, method, and property details, see the References section.

Distribution & Licensing

When your tools are ready to share or sell, the Distribution guides cover exporting and importing NinjaScript, considerations for compiled assemblies, protection-DLL security, and the full commercial-distribution procedure. User-Based Vendor Licensing covers licensing and authenticating end users.

To manage and sell paid NinjaScript add-ons — licenses, products, and customers — see the Marketplace and its Ecosystem Vendor API.