I would like to build, incrementally, a position in a market. Once a 2nd incremental unit is added, with a stop loss of $x, I would like to move the stop loss of the 1st unit, originally also $x, to breakeven
Yes, you can have directly access to the previous trade open price with TRADEPRICE.
So, you need to place your orders exit at this price plus some distance to keep little profit:
1
2
3
4
5
6
//example for long positions
pointstokeep=2
ifcountofposition>1then
SELLATTRADEPRICE(1)+pointstokeep*pipsizeSTOP
endif
Not tested but it should do the job. Also consider a spread between the last order and the placing of the stop order, for not triggering it too fast (10 points for example) :
Sorry for reusing this thread, but just a short question that’s fitting on this topping: afaik there’s no way to manage a stop for each single position…? so e.g. i open 5 positions, i can only set one stoploss that is valid for all positions, right…? (off course i can get the tradeprice for each position… but there’s nothing like “set stop(x)”, right?
do you know if this feature will be coming in 10.3 or 10.4…? (as i’m stuck on IG’s 10.2…)
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue