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.

@Support: Expiration time on bid / offer
 Post subject: @Support: Expiration time on bid / offer Post rating: 0   New post Posted: Mon 28 Nov, 2011, 21:17 

User rating: 4
Joined: Mon 19 Sep, 2011, 09:55
Posts: 29
Location: Germany,
A while back I asked support if there is a minimum time-offset to apply when setting expiration time on bids / offers. Support said "no".

But, from the messages generated by jforex it seems that expiration time on bid / offer always is rounded down to nearest second!? With nothing in between. This is not indicated in the API documentation.

Example:

2011-11-28 10:03:04 Order FILLED at 1.33852 USD (Parent Order #42526296 PLACE OFFER *** mil. EUR/USD @ 1.33852 EXPIRES: 2011-11-28 10:03:04) - Position #9075307
2011-11-28 10:03:03 OFFER ACCEPTED: #42526296 PLACE OFFER *** mil. EUR/USD @ 1.33851 EXPIRES: 2011-11-28 10:03:04 - Position #9075307
2011-11-28 10:03:03 Order PLACE OFFER ***** EUR/USD @ 1.33851 EXPIRES:2011-11-28 10:03:04.839 GMT is sent at 2011-11-28 10:03:03.841 GMT by the strategy

Now, can you explain to me what happened in this example:

2011-11-28 09:01:14 Order FILLED at 1.33603 USD (Parent Order #42517293 PLACE OFFER *** mil. EUR/USD @ 1.33603 EXPIRES after: 09 hour 01 min 13 sec) - Position #9073343
2011-11-28 09:01:12 OFFER ACCEPTED: #42517293 PLACE OFFER *** mil. EUR/USD @ 1.33595 EXPIRES: 2011-11-28 09:01:13 - Position #9073343
2011-11-28 09:01:12 Order PLACE OFFER ***** EUR/USD @ 1.33595 EXPIRES:2011-11-28 09:01:13.843 GMT is sent at 2011-11-28 09:01:12.891 GMT by the strategy

The part that reads "EXPIRES after: 09 hour 01 min 13 sec" was not intended. The expiration date has clearly been set to approximately +1 second after the time the order has been sent!

It is truly regrettable that Dukascopy does not support IOC orders. How to emulate IOC?

When using market orders with slippage, does this warrant that the order will not be executed past slippage?


 
 Post subject: Re: @Support: Expiration time on bid / offer Post rating: 0   New post Posted: Tue 29 Nov, 2011, 10:49 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
astro wrote:
Now, can you explain to me what happened in this example:

2011-11-28 09:01:14 Order FILLED at 1.33603 USD (Parent Order #42517293 PLACE OFFER *** mil. EUR/USD @ 1.33603 EXPIRES after: 09 hour 01 min 13 sec) - Position #9073343
2011-11-28 09:01:12 OFFER ACCEPTED: #42517293 PLACE OFFER *** mil. EUR/USD @ 1.33595 EXPIRES: 2011-11-28 09:01:13 - Position #9073343
2011-11-28 09:01:12 Order PLACE OFFER ***** EUR/USD @ 1.33595 EXPIRES:2011-11-28 09:01:13.843 GMT is sent at 2011-11-28 09:01:12.891 GMT by the strategy

The part that reads "EXPIRES after: 09 hour 01 min 13 sec" was not intended. The expiration date has clearly been set to approximately +1 second after the time the order has been sent!
This is due to platform time formatting, which does not include milliseconds. Expiry time on server works with your given time in milliseconds.
astro wrote:
It is truly regrettable that Dukascopy does not support IOC orders. How to emulate IOC?
The principle gets applied to Market orders, for conditional orders you can always do it within your strategy. Consider adjusting the onMessage method of the strategy example in https://www.dukascopy.com/wiki/index.php?title=Place_Bid to the following:
   @Override
   public void onMessage(IMessage message) throws JFException {
      if(message.getType() == IMessage.Type.ORDER_SUBMIT_OK && message.getOrder() == this.order){
         order.waitForUpdate(500);
         //order not filled 0.5 secs after opening - cancel it
         if(order.getState() != IOrder.State.FILLED){   
            order.close();
         }
      }
      
      //print all order related messages
      if(message.getOrder() != null){
         console.getOut().println(sdf.format(message.getCreationTime()) + " " +message);
      }
   }
Also see:
https://www.dukascopy.com/wiki/index.php ... es_diagram
astro wrote:
When using market orders with slippage, does this warrant that the order will not be executed past slippage?
Yes.


 

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