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.

Mistakes in Interface IOrder Documentation
 Post subject: Mistakes in Interface IOrder Documentation Post rating: 0   New post Posted: Sun 18 Aug, 2013, 21:40 

User rating: 2
Joined: Tue 11 Jun, 2013, 05:24
Posts: 7
Documentation for IOrder.setRequestedAmount(double) says
https://www.dukascopy.com/client/javadoc ... unt(double)
Quote:
Throws:
JFException - if order is not in IOrder.State.OPENED state or amount is not 0 for IOrder.State.FILLED state or if amount is less than a minimum allowed

In practice, order.setRequestedAmount() on a FILLED order will raise JFException even if amount is 0.0.
Quote:
2013-08-18 13:34:17.565 ERROR TesterClientImpl$DefaultStrategyExceptionHandler - Exception thrown while running onBar method: Cannot change amount of filled, closed or canceled order
com.dukascopy.api.JFException: Cannot change amount of filled, closed or canceled order
at com.dukascopy.dds2.greed.agent.strategy.tester.TesterCustodian.changeAmount(TesterCustodian.java:1620)
at com.dukascopy.dds2.greed.agent.strategy.tester.TesterOrder.setRequestedAmount(TesterOrder.java:173)


 
 Post subject: Re: Mistakes in Interface IOrder Documentation Post rating: 0   New post Posted: Sun 18 Aug, 2013, 23:03 

User rating: 2
Joined: Tue 11 Jun, 2013, 05:24
Posts: 7
Additionally, while you're in there,
WarningMessage("Attempt to change amount of the order ... with the same value. Old amount [ ...
is unnecessary. If new amount is same as old amount, there is no reason to complain. It just means I need to add more logic to avoid a log flood.


 
 Post subject: Re: Mistakes in Interface IOrder Documentation Post rating: 0   New post Posted: Mon 19 Aug, 2013, 07:30 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
GPEngine wrote:
In practice, order.setRequestedAmount() on a FILLED order will raise JFException even if amount is 0.0.
This will get updated, but why would you need to set the amount to 0 if it is 0 already?
GPEngine wrote:
If new amount is same as old amount, there is no reason to complain. It just means I need to add more logic to avoid a log flood.
It will not only avoid logging, but will make your strategy avoid making redundant method calls.


 
 Post subject: Re: Mistakes in Interface IOrder Documentation Post rating: 0   New post Posted: Tue 20 Aug, 2013, 04:48 

User rating: 2
Joined: Tue 11 Jun, 2013, 05:24
Posts: 7
What if it is only partially FILLED? My instruction is , forget about the unfilled part.
:)


 
 Post subject: Re: Mistakes in Interface IOrder Documentation Post rating: 0   New post Posted: Tue 20 Aug, 2013, 07:20 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
GPEngine wrote:
What if it is only partially FILLED?
See: https://www.dukascopy.com/wiki/#Order_state/Market_order_states_diagram
and here how to cancel the unfilled part: https://www.dukascopy.com/wiki/#Immediate_Or_Cancel_Order


 

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