Takeprofit for Long (Buy) = Ask + takeprofit
Stoploss = Ask - stoploss
Takeprofit for Sell (Short) = Bid - takeprofit
Stoploss = Bid + stoploss
Notice the + - and work from there. This is the example.
Therefore, if order '1' is an existing short position, I should use below codes. Correct?
If(target<Ask) OrderModify(1, OrderOpenPrice(),0,target,0);
deysmacro's post assumes that
If you are using a chart price (lowest low/highest high) then for a sell order only, you must add the spread. Chart prices are Bid prices, sells close at the Ask.
What do you mean with "network goes down"?
You know my code will modify the takeprofit based on lastest market price. Just set takeprofit based on 'Ask' as it's a short order.
To add comments, please log in or register