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.

order.getLabel() gives the same as order.getId() on Global Account
 Post subject: order.getLabel() gives the same as order.getId() on Global Account Post rating: 0   New post Posted: Thu 08 Aug, 2013, 17:28 
User avatar

User rating: 0
Joined: Wed 10 Oct, 2012, 09:47
Posts: 33
Location: GermanyGermany
Hello,
could it be that on global account orderLabel will be overwritten by orderId? When submitting order I used label "EUUS_Neo_1375740000513" (here the some name and time of machine in millis as label).
Later I realized that label of the order was changed to its orderId.
Making it more clear:
Following code on method
public void onTick(Instrument instrument, ITick tick) throws JFException {
   
        for (IOrder order : engine.getOrders(instrument))
        {
            if ( order.getState() == IOrder.State.FILLED  )
            {       
                console.getOut().println("Order is "+order.getOrderCommand()+", Time:" + dateFormatMR.format(order.getFillTime())+",   amount="+order.getAmount()+",
Price="+order.getOpenPrice()+", StopLossPrice="+ order.getStopLossPrice()+", TakeProfitPrice="+ order.getTakeProfitPrice()+ " getId="+order.getId() + " getLabel=" + order.getLabel());       
    }


gives:

Order is BUY, Time:05.08.2013 22:00:01, amount=0.200122, Price=1.32622, StopLossPrice=0.0, TakeProfitPrice=0.0 getId=26614EUR/USD getLabel=26614EUR/USD

Could you clarify it, please?


 
 Post subject: Re: order.getLabel() gives the same as order.getId() on Global Account Post rating: 0   New post Posted: Mon 12 Aug, 2013, 07:50 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
On global accounts labels get used only before order fill. On global accounts orders on fill get merged to the instrument's position, which has only id and no label.


 
 Post subject: Re: order.getLabel() gives the same as order.getId() on Global Account Post rating: 0   New post Posted: Mon 12 Aug, 2013, 18:24 
User avatar

User rating: 0
Joined: Wed 10 Oct, 2012, 09:47
Posts: 33
Location: GermanyGermany
thank you for clarifying it!
What happens if I open a second order in the same direction as already opened first one. Will I have 2 different orderId's?


 
 Post subject: Re: order.getLabel() gives the same as order.getId() on Global Account Post rating: 0   New post Posted: Tue 13 Aug, 2013, 07:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
There is always one position per instrument. A newly filled order does not change the id of the existing position. You can also make sure of it by carrying out manual trading tests.


 

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