Dear Support,
How can I create multiple ITextChartObject objects in a strategy?
I am using this wikipage as example:
https://www.dukascopy.com/wiki/#Chart_object_catalog/TextI want to place a new text object whenever a condition is fulfilled in my strategy`s onBar() function. However not a new text object being created every time, but the first one is being moved.
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException
{
....
ITextChartObject text = factory.createText("textKey", prevBar.getTime(), prevBar.getLow());
text.setText("Hello world");
chart.addToMainChart(text);
....
}
text is again, and again, newly declared (and defined) in the onBar function as a ITextChartObject variable. I would say a new ITextChartObject variable is being created, so I would suspect that this way multiple variables are being created. This is not the case.
If text would be a pointer to a ITextChartObject variable, I could imagine why it is always the same object on the bar, but not this way.
I know that manually, on a chart multiple chart objects can be placed, so I guess there must be a way to do this programatically.
Please advice.
Thanks and regards.