Since last update of JForex Api I noticed that calling IChartObjectFactory.createChartWidget, when no ICustomWidgetChartObject has been displayed before the call, causes security prompt to appear. Then, regardless of clicking Ok or Cancel, it often hangs the platform for 10 or so seconds.
One workaround is to always have at least one open chart with OHLC index on it.
Steps to reproduce the problem (tested on Windows 7 with Java 7 55):
1. Close all charts.
2. Open single EUR/USD chart and remove all custom chart widgets (OHLC index, ...)
3. Close and reopen the platfom (to make sure that no ICustomWidgetChartObject was displayed before running the strategy).
4. Run attached strategy (Eval.java).
package jforex;
import com.dukascopy.api.IAccount;
import com.dukascopy.api.IBar;
import com.dukascopy.api.IChart;
import com.dukascopy.api.IConsole;
import com.dukascopy.api.IContext;
import com.dukascopy.api.IEngine;
import com.dukascopy.api.IMessage;
import com.dukascopy.api.IStrategy;
import com.dukascopy.api.ITick;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.Period;
import com.dukascopy.api.drawings.IChartObjectFactory;
import com.dukascopy.api.drawings.ICustomWidgetChartObject;
public class Eval implements IStrategy {
private IContext context;
private IConsole console;
@Override
public void onStart(IContext context) throws JFException {
this.context = context;
this.console = context.getConsole();
IChartObjectFactory factory = context.getLastActiveChart().getChartObjectFactory();
ICustomWidgetChartObject widget = factory.createChartWidget();
}
@Override
public void onStop() throws JFException {
}
@Override
public void onAccount(IAccount account) throws JFException {
}
@Override
public void onMessage(IMessage message) throws JFException {
}
@Override
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
}
@Override
public void onTick(Instrument instrument, ITick tick) throws JFException {
}
}