Strategy module, exception Duplicate Chart object key in "another" chart
hyperscalper
Post subject: Strategy module, exception Duplicate Chart object key in "another" chart
Post rating: 0
Posted: Thu 24 Jan, 2013, 20:32
User rating: 98
Joined: Mon 23 Jul, 2012, 02:02 Posts: 656 Location: United States, Durham, NC
If a Strategy module places objects on a specific chart, it can happen that another chart has exactly that same key identified object (perhaps from a previous run, and the key chart object was not removed).
Is there a way for a Strategy module to iterate through ALL charts and to remove these duplicate keys, so it can proceed on its desired chart?
What is the recommended way of handling this issue in Strategy code from within the JForex platform environment?
I hope that made sense.
HyperScalper
API Support
Post subject: Re: Strategy module, exception Duplicate Chart object key in "another" chart
You can iterate through all charts the following way: https://www.dukascopy.com/wiki/#Draw_on_all_charts And then call IChartPanel.getAll(). Note that the key uniqueness is not IChart-bound, rather IChartPanel-bound. Hence, if your strategies draw on indicator panels, then you would also need to iterate through IChart.getIndicatorPanels().