Add a secondary time/data series

This free NinjaScript strategy will add a secondary data series to your strategy.

This NinjaScript download is a single zip file that you import directly into NinjaTrader. It’s not assembled which means you have full access to view and change the source code either in NinjaScript Editor or your preferred way to edit .cs files.

Details / Instructions:
An example use case for this would be if your entry signal is a 1000 tick moving average crossing over a 5 minute moving average. The only way to access different time frames in one strategy is to add a second data series.

There’s only one line that you need to add the series (the line that calls the¬†AddDataSeries method), but there’s another important line at the beginning of OnBarUpdate that prevents OnBarUpdate from running on both data series.

This code will not work with releases prior to NinjaTrader 8. Click here if you don’t know how to install NT strategies. Use at your own risk, and backtest backtest backtest before you go live with any strategy.

Leave a Reply

Your email address will not be published. Required fields are marked *