Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Help with a Strategy
Collapse
X
-
Help with a Strategy
Hi, Sorry for the generic title but I just need someone to help me understand why the attached strategy I have written requires 21 days of data loaded when I expect it to require 14. I have three timeframes in the script, 1 Minute, 5 Minute and Daily. The Daily is used to calculate the ATR 14 period and hence I would expect to need 14 days of data loaded but the script won't work with less than 21 days of data. Can you please take a look at the attached .cs file and advise?Tags: None
-
Hello, thanks for writing in. This is coming from the weekends being ignored. E.g. if you load 15 days of 1 minute data until today, you will get 12 bars because the weekends are ignored. You can test it out with this code:
Code:if(BarsInProgress == 0) { if(Bars.IsFirstBarOfSession) { Print("Minute Series " + CurrentBars[0] + " " + Times[0][0]); } } if(BarsInProgress == 1) { Print("Daily Series " + CurrentBars[1] + " " + Times[1][0]); Print(" "); if(CurrentBars[1] < 14) return; Print("CurrentBar " + CurrentBars[1]); Print("Daily ATR Value " + ATR(BarsArray[1], 14)[0]); }
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
477 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
317 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
256 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
340 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
308 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment