Problem with orderSend

240 views
Skip to first unread message

tbry...@gmail.com

unread,
Aug 31, 2015, 3:00:39 PM8/31/15
to NJ4X Forum
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


Roman Gerasimenko

unread,
Aug 31, 2015, 3:02:29 PM8/31/15
to NJ4X Forum
It is nothing to do with nj4x api.
Please check you are not using investor's password for your demo account.


--
You received this message because you are subscribed to the Google Groups "NJ4X Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nj4x+uns...@googlegroups.com.
To post to this group, send email to nj...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages