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 Management
 Post subject: Order Management Post rating: 0   New post Posted: Tue 31 Jul, 2012, 01:48 

User rating: 0
Joined: Fri 25 Nov, 2011, 02:49
Posts: 17
Location: Malaysia,
I have this standard bit of code in my strategy

[code]// PLACE ORDER
if (buySign) {
if (order == null || !order.isLong()) {
closeOrder(order,0);
order = submitOrder(OrderCommand.BUY, instrument);
isPratillyClosed = false;
}

} else if (sellSign) {
if (order == null || order.isLong() ) {
closeOrder(order,0);
order = submitOrder(OrderCommand.SELL, instrument);
isPratillyClosed = false;
}


Is it possible to have so it only closes a Long/Short and open a Short/Long if the trade is in Negative pips . If trade is positive pip ignore close open opposite

Thanks


 
 Post subject: Re: Order Management Post rating: 0   New post Posted: Tue 31 Jul, 2012, 07:27 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
use IOrder.getProfitLossInPips, see the usage example here:
https://www.dukascopy.com/wiki/#Order_Management/Get_all_profitable/losing_orders


 

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