1.You have to cycle through of the chart with a code like this
for (Instrument instrument : context.getSubscribedInstruments()) {
for (IChart chart : context.getCharts(instrument)) {
}
// add code here for all the charts
}
Of course, you have to do this not only once, but from time to time (let's say every 1-2 seconds), so if you open a new chart while the strategy is running, the strategy will detect it.
There is a nice example in the wiki about how to execute a task over and over again:
https://www.dukascopy.com/wiki/#Threadin ... _execution2.I am not aware if you can move the label what is used in the example to somewhere else. But you have better tools to place custom text or labels anywhere on the chart.
Again, there are nice examples in the wiki about this:
There is the
Chart Widget, which can be used to place an OHLC type info box on the chart, so you can move it after it is drawn. This is a good choice.
Or you can use the
Screen Label component, which is a bit simpler, and you cannot move it once placed.
Good luck,
and if you stuck, just let us know.