![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jan 2009
Posts: 216
Thanks: 0
Thanked 1 time in 1 post
|
Hi NT experts,
In your sample code on SampleMultiTimeFrame, the condition is to process event on BarsInProgress =0: if (BarsInProgress != 0) return; However, the following code starts to evalaute values on BarsInProgress 1 and 2: if (SMA(BarsArray[1], 5)[0] > SMA(BarsArray[1], 50)[0] && SMA(BarsArray[2], 5)[0] > SMA(BarsArray[2], 50)[0]) I would assume SMA(BarsArray[1], 5)[0] would produce an error as it tries to get value from BarsArray[1] instead of 0. A realted question. What if no such contions as if (BarsInProgress != 0) return; Will this sample prouce same results? Regards, |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|