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 SL and openprice of one filled order
 Post subject: how to get SL and openprice of one filled order Post rating: 0   New post Posted: Thu 03 Feb, 2011, 13:15 

User rating: 0
Joined: Thu 24 Jun, 2010, 04:04
Posts: 27
if i have a short position of eu opened at 137000 with SL= 137010,and by what api i can get a return with

SL


 
 Post subject: Re: how to get SL and openprice of one filled order Post rating: 0   New post Posted: Fri 04 Feb, 2011, 10:38 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi, you can use the IOrder.getOpenPrice() and IOrder.getStopLossPrice() to get the order open price and the order stop loss price. Please consider the following code:
for (IOrder curOrder: engine.getOrders()) {
    console.getOut().println("Order open price: " + curOrder.getOpenPrice());
    console.getOut().println("Order SL: " + curOrder.getStopLossPrice());
}


 
 Post subject: Re: how to get SL and openprice of one filled order Post rating: 0   New post Posted: Mon 07 Feb, 2011, 07:19 

User rating: 0
Joined: Thu 24 Jun, 2010, 04:04
Posts: 27
Support wrote:
Hi, you can use the IOrder.getOpenPrice() and IOrder.getStopLossPrice() to get the order open price and the order stop loss price. Please consider the following code:
for (IOrder curOrder: engine.getOrders()) {
    console.getOut().println("Order open price: " + curOrder.getOpenPrice());
    console.getOut().println("Order SL: " + curOrder.getStopLossPrice());
}


and if i have a group of orders ,can i compare the open price of an order and its SL, one by one?


 
 Post subject: Re: how to get SL and openprice of one filled order Post rating: 0   New post Posted: Mon 07 Feb, 2011, 09:03 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
liyinan wrote:
and if i have a group of orders ,can i compare the open price of an order and its SL, one by one?

If you have created the order with a SL and a TP, you can get the order and check if it has the SL and the TP. The IEngine.getOrders() method iterate orders with a different position Id.


 

Jump to:  

cron
  © 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