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.

OriginalAmount is not set at order submit, why?
 Post subject: OriginalAmount is not set at order submit, why? Post rating: 0   New post Posted: Sun 28 Mar, 2021, 21:30 
User avatar

User rating: 21
Joined: Thu 19 May, 2011, 20:50
Posts: 404
Location: Germany, Munich
The API says:
getOriginalAmount()
Returns original constant amount of the order. The value is set on order submit and cannot be changed later.
https://www.dukascopy.com/client/javado ... alAmount--

But when I test this I get the following result:
20:22:06 checking order jf1aatqo5, state = FILLED, order.getOriginalAmount() = 1.0E-6, order.getAmount() = 1.0E-6, order.getRequestedAmount() = 1.0E-6
20:22:06 checking order jf1aatqo5, state = OPENED, order.getOriginalAmount() = 0.0, order.getAmount() = 1.0E-6, order.getRequestedAmount() = 1.0E-6
20:22:05 checking order jf1aatqo5, state = OPENED, order.getOriginalAmount() = 0.0, order.getAmount() = 1.0E-6, order.getRequestedAmount() = 1.0E-6
20:22:05 checking order jf1aatqo5, state = CREATED, order.getOriginalAmount() = 0.0, order.getAmount() = 0.0, order.getRequestedAmount() = 0.0


read from bottom up.

I simply added this to the onMessage function:
    public void onMessage(IMessage message) throws JFException {
        IOrder order = message.getOrder();
        if (order == null) return;
        console.getOut().println("checking order "+order.getLabel()+", state = "+order.getState()+", order.getOriginalAmount() = "+order.getOriginalAmount()+", order.getAmount() = "+order.getAmount()+", order.getRequestedAmount() = "+order.getRequestedAmount());
    }


Why is getOriginalAmount set on a fill only?


 
 Post subject: Re: OriginalAmount is not set at order submit, why? Post rating: 0   New post Posted: Thu 06 May, 2021, 16:31 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6118
Greetings.

Current logic for orders is the following: Original amount is set immediately only for orders that are submitted by strategy.
For orders submitted from JForex platform manually, original amount is set only when order is filled.

Regards.


 

Jump to:  

  © 1998-2011 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