Everething is ok with code, i guess. I get the "conn" message on connection exception. Here's piece of it.
package hello;
import com.dukascopy.api.*;
import matlabcontrol.*;
import matlabcontrol.MatlabConnectionException;
import matlabcontrol.MatlabInvocationException;
import com.dukascopy.api.IEngine.OrderCommand;
import com.mathworks.jmi.*;
@Library("jmi.jar;matlabcontrol-4.0.0.jar")
@RequiresFullAccess
public class MA_Play implements IStrategy {
private IContext context = null;
private IEngine engine = null;
private IChart chart = null;
private IIndicators indicators = null;
private boolean posCreated = false;
private int tagCounter = 0;
private double[] ma1 = new double[Instrument.values().length];
private IConsole console;
public void rty() throws MatlabConnectionException, MatlabInvocationException
{
//Create a proxy, which we will use to control MATLAB
MatlabProxyFactory factory = new MatlabProxyFactory();
MatlabProxy proxy = factory.getProxy();
//Disconnect the proxy from MATLAB
//proxy.disconnect();
}
public void onStart(IContext context) throws JFException {
this.console = context.getConsole();
try {rty();
}
catch (MatlabInvocationException e){console.getOut().println("incob");}
catch (MatlabConnectionException e){console.getOut().println("conn");}
this.context = context;
engine = context.getEngine();
indicators = context.getIndicators();
}