I'm just having a little trouble figuring out the best way to utilise OrderModify on an ECN broker.
Basically, I place the order first:
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"Test EA",16384,0,Green);
Then the next line have:
OrderModify(ticket,OrderOpenPrice(),Ask-Point*StopLoss,Ask+Point*TakeProfit,0,Green);
However, if the market is moving quickly then the takeprofit and stoploss will not be placed relative to the entry position, but instead be applied to the Ask at the time it is modified.
I tried the following:
OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice()-Point*StopLoss,OrderOpenPrice()+Point*TakeProfit,0,Green);
However that throws an error in the console and doesn't accept the modify order.
Any ideas? Thanks!
Basically, I place the order first:
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"Test EA",16384,0,Green);
Then the next line have:
OrderModify(ticket,OrderOpenPrice(),Ask-Point*StopLoss,Ask+Point*TakeProfit,0,Green);
However, if the market is moving quickly then the takeprofit and stoploss will not be placed relative to the entry position, but instead be applied to the Ask at the time it is modified.
I tried the following:
OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice()-Point*StopLoss,OrderOpenPrice()+Point*TakeProfit,0,Green);
However that throws an error in the console and doesn't accept the modify order.
Any ideas? Thanks!