Backtesting NinjaScript Strategies with an intrabar granularity

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Educational Resources > Reference Samples > Strategy >

Backtesting NinjaScript Strategies with an intrabar granularity

Previous page Return to chapter overview Next page

You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by submitting your orders to a more granular secondary bar series to achieve an "intrabar" fill.

 

Key concepts in this example

Finding entry conditions on the primary bar object

Submitting orders to the secondary bar object for an intrabar fill

 

Important related documentation

AddDataSeries()

BarsInProgress

EnterLong()

BarsArray

EnterLongLimit()

 

Import instructions

1.Download the file contained in this Help Guide topic to your PC desktop

2.From the Control Center window, select the menu Tools > Import > NinjaScript

3.Select the downloaded file

 

SampleIntrabarBacktest_NT8.zip