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.

Inconsistent behavior of IOrder.getCommission method
 Post subject: Inconsistent behavior of IOrder.getCommission method Post rating: 0   New post Posted: Thu 07 Nov, 2013, 07:47 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
My strategy (code is attached) submit a market order and then close it. And the strategy repeats these actions three times.
The value returned by the IOrder.getCommission method for the 3rd order differs from the values for the 1st and 2nd orders.
06:32:06 The 3rd order: Commission after position CLOSING: 0.07 -- WRONG
06:32:05 The 3rd order: Commission before position CLOSING: 0.07
06:32:04 The 3rd order: Commission after position OPENING: 0.07
06:32:03 The 2nd order: Commission after position CLOSING: 0.14
06:32:02 The 2nd order: Commission after position OPENING: 0.07
06:32:01 The 1st order: Commission after position CLOSING: 0.14
06:32:00 The 1st order: Commission after position OPENING: 0.07


Attachments:
File comment: All of three orders are the same. But values of getCommission differs.
JFCommissions.java [3.41 KiB]
Downloaded 115 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Inconsistent behavior of IOrder.getCommission method Post rating: 0   New post Posted: Tue 26 Nov, 2013, 10:37 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This is because the strategy execution has been stopped at that moment. The strategy may call order change operations, but the order objects will no longer get updated, because, as we already mentioned, it has been stopped. If you added at the end of the onStop method the line out.println(orderC);, you would see that the order shows as FILLED, not CLOSED. In general the onStop method is meant for clean-up, disposal operations in case of intentional strategy stop or its stop because of some error.


 

Jump to:  

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