protected override void OnBarUpdate()
{
// Prints the current bar time stamp
Print(Time[0].ToString());
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Question about OnBarUpdate()
Collapse
X
-
Question about OnBarUpdate()
Here's my code:
Since CalculateOnBarClose is set to true as default, it's supposed to only print on the close of each bar. However, the output window continuously prints timestamps even the bar is not closed. Am i missing something?Code: -
-
Hi misotrader,
Thank you. This screenshot shows that a secondary data series has not been added to the script.
May we have a screenshot of the parameters for this indicator as its set on the chart?
Right-click the chart -> select Indicators... -> select the Indicator -> take a screenshot
(So we can confirm that CalculateOnBarClose is set to True)
Also, may we have the output from the output window?
Right-click the Output window -> select Save As... -> give the file a name and save locationChelsea B.NinjaTrader Customer Service
Comment
-
Somehow the chart did not pick up the updated parameter even it's compiled and rerun.
I explicitly set CalculateOnBarClose to true in chart -> Indicators, now it works!
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
174 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
329 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
252 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
355 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
182 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment