Modify stop loss
Created at 16 Sep 2020, 10:25
LU
Modify stop loss
16 Sep 2020, 10:25
hi my bot should modify the stop loss (using ModifyOrder) when it reaches the stop loss minus 0.2 pips
how can I do?
thanks
Replies
luca.tocchi
18 Sep 2020, 16:40
RE: RE:
firemyst said:
luca.tocchi said:
hi my bot should modify the stop loss (using ModifyOrder) when it reaches the stop loss minus 0.2 pips
how can I do?
thanks
//for long positions
if ((Symbol.Bid - CurrentStopLossValue) / Symbol.PipSize <= 0.2)
{
//price is within 0.2 pips of SL
p.ModifiyStopLossPips //or p.ModifyStopLossPrice depending on what you want to do
}
Thanks a lot!
@luca.tocchi
firemyst
17 Sep 2020, 07:48
RE:
luca.tocchi said:
//for long positions
if ((Symbol.Bid - CurrentStopLossValue) / Symbol.PipSize <= 0.2)
{
//price is within 0.2 pips of SL
p.ModifiyStopLossPips //or p.ModifyStopLossPrice depending on what you want to do
}
@firemyst