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.

closetime?
 Post subject: closetime? Post rating: 0   New post Posted: Mon 25 Jan, 2010, 15:47 
User avatar

User rating: 0
Joined: Thu 16 Jun, 2011, 21:37
Posts: 98
Location: SwitzerlandSwitzerland
hi, I was wondering how I get the time for an order that has been stopped out? would it be the last order in my orders list?

List <IOrder> orders = engine.getOrders(instrument);

Then I just do
if(orders.get(orders.size()-1).getState() == IOrder.State.CLOSED)

long closeTime = orders.get(orders.size()-1).getFillTime();

thanks for the input,
jForexUser


 
 Post subject: Re: closetime? Post rating: 0   New post Posted: Mon 25 Jan, 2010, 21:41 

User rating: 0
Joined: Fri 15 Jan, 2010, 13:58
Posts: 8
Hi,
I'm trying to do quite similar. I.e how to get a profit or a close price for three last closed orders?


 
 Post subject: Re: closetime? Post rating: 0   New post Posted: Tue 26 Jan, 2010, 10:10 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
getOrders will not return closed orders
If you need close price or profit for the three last closed orders, you need to catch IMessage.Type.ORDER_CLOSE_OK events in onMessage method, chack that it wasn't partial close and save order in some class variable in your strategy


 

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