Hi guys,
short question. Is it possible to open two different positions simultaneously, both with 20 pip limit but one with 10 pip sl and the other with 20 pip sl?
Sincerely
/Mikael
No, because every time you execute SET STOP LOSS and SET TARGET PROFIT, all open positions will be updated to the new value.
You can do it yourself by keeping track of positions entered and using pending STOP orders to manage their SL.
No, because every time you execute SET STOP LOSS and SET TARGET PROFIT, all open positions will be updated to the new value.
Yes…. but I faced a problem at the weekend similar to this and used:
If not onmarket then
Set stop/profit etc
End if
And it did the job for me!
that wont solve opening 2 different stops, but it did stop my profits and stops updating every bar. Perhaps theres something clever someone can do with variables and once statements? Not sure
Not tested:
//Get more accurate entry price once on market in case there was a gap
if onmarket and not onmarket[1] then
if countofposition = 2 then
entryprice = tradeprice
endif
if countofposition = 1 then
entryprice = tradeprice[2]
endif
endif
//Pending orders for two positions open
if onmarket and countofposition = 2 then
sell at entryprice + 20 limit
sell 1 contract at entryprice - 10 stop
sell 1 contract at entryprice - 20 stop
endif
//Pending orders for one position open
if onmarket and countofposition = 1 then
sell at entryprice + 20 limit
sell 1 contract at entryprice - 20 stop
endif
//Enter market and place pending orders for two positions
if not onmarket and (your entry conditions) then
buy 2 contracts at market
sell at close + 20 limit
sell 1 contract at close - 10 stop
sell 1 contract at close - 20 stop
endif
Is it possible to open two different positions simultaneously, both with 20 pip limit but one with 10 pip sl and the other with 20 pip sl?
Yes with partial closure of position.