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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
152 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
87 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
131 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
106 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment