Dukascopy
 
 
Wiki JStore Search Login

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

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

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

incorrect expiration time
 Post subject: incorrect expiration time Post rating: 0   New post Posted: Thu 11 Oct, 2018, 19:19 

User rating: 0
Joined: Tue 02 Jan, 2018, 23:02
Posts: 4
hi,

i am sending bid/offer orders with > 1 second expiration time. i keep getting this error:

Order PLACE BID 1000 EUR/NZD @ 1.78557 EXPIRES:2018-10-10 21:39:33.650 GMT is sent at 2018-10-10 21:39:32.474 GMT by the strategy "StratFeed": from the local computer
Your order has been rejected due to validation failure. incorrect expiration time
2018-10-10 21:39:33.489 INFO StratFeed - Message Type: ORDER_SUBMIT_REJECTED; Text: VALIDATION_ERROR-Your order has been rejected due to validation failure. incorrect expiration time; Related Order: [O18300776072047]-CREATED / EUR/NZD / 1.78557 / 0.001 / 0.001

notice that i get the rejection message BEFORE my order is due to expire.


 
 Post subject: Re: incorrect expiration time Post rating: 0   New post Posted: Fri 12 Oct, 2018, 08:40 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hello,

There much depends on how your strategy calculates goodTillTime parameter. It is just hardcoded to 1000ms, or some function? Provide some code sample, which produces this error.


 
 Post subject: Re: incorrect expiration time Post rating: 0   New post Posted: Fri 12 Oct, 2018, 09:29 

User rating: 0
Joined: Tue 02 Jan, 2018, 23:02
Posts: 4
thank you very much for the quick reply! my code has a dynamic goodTillTime but i have a minimum set to 1000ms. it essentially looks like this:

if (gft >= 1000) {
   engine.submitOrder(getLabel(), inst, OrderCommand.PLACE_BID, getamount(), getPrice(), 0, 0, 0, System.currentTimeMillis() + gft);
}


what i don't understand is how the server rejects my order before it is set to expire. the JForex logs show correct timestamps (i.e. in the future) every time. also, this doesn't ALWAYS happen -- just about 50% of the time.


 
 Post subject: Re: incorrect expiration time Post rating: 1   New post Posted: Fri 12 Oct, 2018, 11:58 

User rating: 18
Joined: Thu 20 Apr, 2017, 22:42
Posts: 165
Location: Russian Federation,
I suppose this may happen because time on client does not exactly match time on server. '1 sec' is rather short period, for example if your local time is 0.5+ sec ahead of server time - then you get few milliseconds left for network traffic of variable latency, what depends on how far you physically away from dukas' servers ...


 

Jump to:  

cron
  © 1998-2024 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