So i how have updated my strategy to update my own Data series once the FirstTickOfBar == True; and I am now expecting LinReg of both Closes[1] (10 Min Bars) and fastClose (Based on 10 Min Bars), to be the same but they still are not and Im not sure why. I have attached a script to demonstrate the probelm.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Update Mehtod
Collapse
X
-
Hi Patrick,
So i how have updated my strategy to update my own Data series once the FirstTickOfBar == True; and I am now expecting LinReg of both Closes[1] (10 Min Bars) and fastClose (Based on 10 Min Bars), to be the same but they still are not and Im not sure why. I have attached a script to demonstrate the probelm.
-
Hello GKonheiser,
There is no need for the Historical or CalculateOnBarClose check. On the first tick of the bar I would also set it as the following:
So both the prior bar is set and the current tick.Code:// set fastClose index 1 to the 10 min bar just closed fastClose.Set(1, Closes[1][1]); fastClose.Set(0, Closes[1][0]);
Comment
-
Im doing the check for historical or CalculateOnBarClose as in that case on the FirstTickOrBar my customDataSeries index 1 would be Closes[1][0] where as if we are running on live data with CalulateOnBarClose == false it would be Closes[1][1].
Is that logic not correct ?
Comment
-
There should be no need to perform it in that way, I would use the code below only:
Code:if( BarsInProgress == 1 ) { ... // FIRST TICK OF BAR SO SET OUR DATA SERIES if(FirstTickOfBar) { ... // set fastClose index 1 to the 10 min bar just closed fastClose.Set(1, Closes[1][1]); fastClose.Set(0, Closes[1][0]);
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
153 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
89 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
133 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
127 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
107 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment