How to set a stop loss?

I am doing a backtest and I set the maximum loss stop at 1%:

However, when I take a look at the report, I find losses of more than 1%. Could please explain me why is that? and how can I fix it?

Best regards,

Check out "Exit at trade price only (0)" of stops settings.
Set to Exit intraday at high low prices.

1 Like

thank you , I change it to Exit intraday at stop (1) and now it works. Thanks.

I’d also recommend looking at the Applystop() function. If it’s in your AFL it will override the backtest GUI settings, same as any option set in AFL.

You’ll find it beneficial to keep track of instead of manually entering in settings. Makes it easier when AFL scripts start piling up. Settings you have to set each time or load saved settings.

And the setoption() function. You can create a code snippet as a template for your AFL. I have a snippet set in editor for options I set regularly like positionsize, max open positions , and initial equity. Very handy when keeping track of AFL and reports to see everything in the script.

1 Like

Thank you very much @Metamega, it is really helpful. I appreciate it.