Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Code for knowing if an order was rejected (E.g when using slippage 0)
 Post subject: Code for knowing if an order was rejected (E.g when using slippage 0) Post rating: 0   New post Posted: Thu 08 Sep, 2016, 13:47 
User avatar

User rating: 0
Joined: Tue 06 Sep, 2016, 11:04
Posts: 20
Location: United Kingdom,
Hello,

If I try to open an order with slippage 0, sometimes it's rejected. Here is an example:
order = engine.submitOrder("MyOrder", myInstrument, myCommand, 0.01, orderPrice, 0);

What code should I use to know if the order was rejected or not?

Thanks


 
 Post subject: Re: Code for knowing if an order was rejected (E.g when using slippage 0) Post rating: 0   New post Posted: Fri 09 Sep, 2016, 09:05 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
One way could be to wait for the order to execute and inspect the result order.getState()

https://www.dukascopy.com/wiki/#Manage_ ... tForUpdate


 
 Post subject: Re: Code for knowing if an order was rejected (E.g when using slippage 0) Post rating: 0   New post Posted: Mon 12 Sep, 2016, 13:42 
User avatar

User rating: 0
Joined: Tue 06 Sep, 2016, 11:04
Posts: 20
Location: United Kingdom,
Works! Thank you


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com