Hello,
I'm trying to integrate R(similar to Matlab) within JForex via rJava and JRI, see
here.
Here is a code snippet:
public void onStart(IContext context) throws JFException {
this.engine = context.getEngine();
this.console = context.getConsole();
this.history = context.getHistory();
this.context = context;
this.indicators = context.getIndicators();
this.userInterface = context.getUserInterface();
this.account = context.getAccount();
try {
String[] test={"--no-save"};
consolePrint("Creating Rengine (with arguments)");
Rengine re=new Rengine(test, false, null);
consolePrint("Rengine created, waiting for R");
if (!re.waitForR()) {
consolePrint("Cannot load R");
return;
}
/* HERE OCCURS JFOREX CRASH ! */
REXP x=re.eval("1+1");
//consolePrint("R response: "+x.asInt());
} catch (Exception e) {
// TODO Auto-generated catch block
consolePrint("exception "+e);
}
//Create instruments objects
for(Instrument i : Instruments){
InstrumentObject iState = new InstrumentObject(i);
InstrumentStateList.add(iState);
}
}
Running this code results in a JForex crash.
The problem is that JForex just closes immediatley and no error message is given.
When removing this critical line:
REXP x=re.eval("1+1");
then JForex runs stable.
If someone here uses also R it would be nice how to run it within JForex.
@Support: Is there any log file where one can see critical crash messages? When JForex closes it also closes the Java console.
Is there any more native debug possibilty?
Thanky you and best regards,
Juergen