HI,
I experienced few times a problem when stop loss suddenly moves above the current price. Sometimes it goes back afterwards. In coding stoploss set to a maxrisk of 1% in $.
Capital = 10000
Risk = 0.01
stopLoss = ATR*4
REM Calculate contracts
equity = Capital + StrategyProfit
maxrisk = round(equity*Risk)
set stop $loss maxrisk
Can anyone clarify that please?
Hi,
i think you should post your whole code.
What’s this ATR-stop line for?
“stopLoss = ATR*4″
Do you refer to this in some part of your code?
Greetings,
Robert