|
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? |
MoneyMechanics
|
Post subject: closetime? |
Post rating: 0
|
Posted: Mon 25 Jan, 2010, 15:47
|
|
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
|
|
|
|
 |
[oktar]
|
Post subject: Re: closetime? |
Post rating: 0
|
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?
|
|
|
|
 |
API Support
|
Post subject: Re: closetime? |
Post rating: 0
|
Posted: Tue 26 Jan, 2010, 10:10
|
|
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
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|