Can any amibroker programming gurus can help me with clearing this concept. I want to add stop loss function to my backtest script and I found this fixed stop loss code.
my question is how amibroker determines a stop loss while backtesting? whether it takes daily change in percentage for stop loss or after completion of a trade
example
First column is the day and second column is the gain/loss percentage. these days are the trading days we kept the stock. After 17 days the above stock gave a total loss of -2.94. in the above data where will amibroker will apply stop. If i am correct on these days 3,8,11,14,16 trade will be exited using my stop loss condition or it will exit when the
Code:
amount = 2; // 2% loss
ApplyStop( stopTypeLoss, stopModePercent, amount, True );
example
Code:
Days | Daily gain/loss percentage
1 1.41
2 -1.34
3 -2.52
4 3.8
5 2.95
6 -0.9
7 1.62
8 -3.86
9 1.23
10 4.82
11 -4.85
12 2.39
13 -0.77
14 -2.56
15 -5.39
16 -3.44
17 4.47
Last edited: