Hello,
I am experiencing problem when calling orderSend() method. This is my buy() function where the orderSend is used:
public long buy(String symbol, double volume) throws Exception{
long ticketNo = strategy.orderSend(
symbol,
TradeOperation.OP_BUY,
volume,
strategy.marketInfo(symbol, MarketInfo.MODE_ASK),
100,
0, 0, "comment", 0, null
);
return ticketNo;
}
And I get this error when I attempt to buy, sell or close:
com.jfx.ErrTradeDisabled: orderSend(symbol=EURUSD, cmd=0, volume=1.0, price=1.12465, slippage=100, stoploss=0.0, takeprofit=0.0, comment=comment, magic=0, expiration=1970.01.01 00:00) -> Trade is disabled
at com.jfx.MT4.orderSend(MT4.java:6296)
at mtbridge.MT4Connection.buy(MT4Connection.java:95)
at mtbridge.Launcher.main(Launcher.java:25)
MT4 Terminal client disconnect...Error no. 133
Function getError() returns 133. Can you please tell me, what the problem is? I am logging into my demo account, where I can make orders with no problems using MetaTrader directly. I noticed that there is jfx activation key set up on initialization using System.setProperty() in the example code. Does it mean that I need to have paid licence to be able make an order? Thanks in advance