When I first implemented this indicator (I call it Radar) in NT7, one of the issues I had to overcome was the fact that, by default, an indicator's Plot() method is only ever called after a new tick event notification has been dispatched to the indicator (in other words, after OnBarUpdate() has been called.) That was a problem because the order book needs to be redisplayed after every change to the state of order book (in other words, after every level 2 market depth event has been dispatched to and processed by the indicator.) To solve the problem, I somehow discovered that I could evaluate ChartControl.ChartPanel.Invalidate(); in the body of the OnMarketDepth() method in order to force redisplay of the indicator after each level 2 event notification (it's an undocumented feature; I no longer remember how I discovered it.)
The problem I now have is that, in NT8, ChartPanel does not have an Invalidate() method, although it does have an InvalidateVisual() method. But attempting to invoke ChartPanel.InvalidateVisual() results in an exception being raised involving thread ownership contention.
I really need a way to have the indicator redraw itself whenever the state of the order book has changed. And more generally, indicators (and strategies, for that matter) should be able to request that they be redrawn whenever they've been notified of any event (level 1, level 2, fundamental data, position change, etc.)
Having an invocable ChartPanel method for that purpose is one way to accomplish that, but it's not the only way, nor is it necessarily the best way. Another way would be to have a specific boolean property which controls whether or not the indicator (or strategy) will be redrawn following each specific type of event notification. And there are other approaches.
But I really need some way to make Radar do in NT8 what it does quite well in NT7. Pretty please?
Thanks!
Comment