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.

how to get profit or stoploss pips of last closed orders?
 Post subject: how to get profit or stoploss pips of last closed orders? Post rating: 0   New post Posted: Thu 03 Jan, 2013, 08:24 
User avatar

User rating: 1
Joined: Sat 24 Sep, 2011, 12:11
Posts: 31
Location: China,
List<IOrder> closedOrder=history.getOrdersHistory(instrument, 0, history.getTimeOfLastTick(instrument)) ;
IOrder lastClosedOrder=closedOrder.get(closedOrder.size()-1);
lastClosedOrder.getProfitLossInPips();


is this right?

I used IHistory interface and is there any better way?


 
 Post subject: Re: how to get profit or stoploss pips of last closed orders? Post rating: 0   New post Posted: Mon 07 Jan, 2013, 09:32 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
It would be better to use a smaller time interval, say, for the last 60 days:
long to = history.getTimeOfLastTick(instrument);
List<IOrder> closedOrder=history.getOrdersHistory(instrument, to - TimeUnit.DAYS.toMillis(60), to) ;


 

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