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 NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
54 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
72 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment