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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
596 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
554 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment