Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Update indicator plot value OnMarketData()
Collapse
X
-
Update indicator plot value OnMarketData()
Hi. I have an indicator value that is calculated on each OnMarketData() call. The plot is located in the OnBarUpdate() method and only seems to get updated whenever the last price moves in any one direction. This is not the desired result. Is it possible to have the indicator plot update whenever the OnMarketData() method is called? If I put the plot in the OnMarketData() method, only the close[0] dataseries is shown for the indicator value.
Thanks.Tags: None
-
Yes I always have calculateonbarclose = false. I tried to lower the refresh rate to 0 in the chart properties, but that locked up the program. I set it to 0.01 and that seemed to do a better job at updating every tick.
Comment
-
You should never really be calling Plot(). Calling it directly can mess things up pretty badly due to race conditions.
Instead you should call invalidate, which triggers Plot() to be called when it is ok to call. You do so something like the following:
ChartControl.ChartPanel.Invalidate();
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
623 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
359 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
562 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
567 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment