Backtest result keep changing

hello all
I Am trading in 15 Minutes Candle Stick in cash segment for waiting period of 2 hours for Stop Loss or target (Exit after 2 Hour from buy or sell condition). In the scan result there are 3 to 7 signal for buy or sell . I select only one signal from, scan result, & trade within that period I did not take in other position, but after completion of that present day I see the back test result shows the another script which I did not trade. So I need to trade on the same which shows the back test result shows for present day.

Will you please guide me how to write code in AFL or what is the setting of back testing.
Waiting for your positive response.

Please explain how to trade as per back test result for present day

Knowledge Base should you your first place to look for answers:


The other reason for changing results may be more subtle formula error.

If your code modifies PER-BACKTEST (global) setting and makes it different for each symbol (which it shouldn't) then results may be different if multiple threads happen to finish in different order.

Say the last two symbols in backtest are: A and B.
And say that you set per-backtest option to value of X for symbol A and value of Y for symbol B.

If symbol A thread finishes as last, the entire portfolio level backtest will use X value for per-backtest option
If symbol B thread finishes as last, the entire portfolio level backtest will use Y value for per-backtest option

The order in which threads finish is pretty random as Windows is pre-emptive multitasking and threads running on different cores with different loads may have different (pretty random) execution times.

It is formula error to use different settings for each symbol for options that are global (per-backtest, not per symbol)

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.