What's the right way to do automatic backtests?

tl;dr: How hard should you look for the best settings when backtesting indicators?

When I figured out how to backtest indicators automatically with scripts I thought it would put my system building on warp speed! “an INSTANT backtest, on any indicator, any setting, any timeframe, any sl/tp rules? sign me the f up!” I thought.

The problem is now I’m spending as much or MORE time on each indicator testing each possible setting to see which shows the best winning percentage and net profit, especially on indi’s that have, like, three Moving Averages with six types you can choose from.

Am I doing it wrong?

On one hand, many indicators have an exact setting or approx setting that seems to work a lot better than the default setting, at least with my the trading style I’m trying to test for. I figure it’s worth seeking those out, right?

On the other hand settings that work best on some pairs are not nearly the best on other pairs. And we can assume that settings that work the best in the past may not work the best in the near future, even if you test a large sample size.

Does anyone else use scripts for backtesting? How do you ascertain which indicators and settings test the best? Perhaps more importantly, how do you log them?

At first I was just writing down the setting that gives the indi the best winning %, but some of the highest only gave a few signals per year. I started going by which settings shows the highest net profit instead, but that seems faulty too because right now I’m only testing individual indicators and combing them with others will change those results.

What’s more, the net profit numbers seems to bounce around wildly just by a small change in the settings. Can an indicator really return that much more profit/loss if one of it’s moving averages is two candles faster, even when the win percentage is about the same?

Hi, one method is looking indicators settings in social website, like forum, sometimes users share ideas and you can conclusions. Regards Greg

1 Like

its seem you have no idea which indicator that you will use…

1 Like

I would like to test as many indicators as I can find :slight_smile:

Hi, do you talk to me? Regards Greg

Hi, focus on majors currency pairs and time frames from M30, you will have enough combinations to check :grinning: Regards Greg

Hi LorimerStankins,

I’m a beginner trader and although I might not be able to help with your question I thought maybe you could help with a question I have?

I am interested in automating my backtesting of trading strategies as have just done it manually the last few days after finishing the babypips school. Could you point me in the right direction with how to get started? I’m a software developer so can write scripts but just don’t know where to start!

Many thanks

1 Like

Hey mike!
So a lot of people trade and test using MT4, but that doesn’t work on new Mac OS’s so I use the website Tradingview. People make all kinds of scripts on there for all kinds of back and forward testing strategies. The one I’ve used the most is this one https://www.tradingview.com/script/Y2UvLNZW-No-Nonsense-NNFX-VP-Strategy-for-Back-Testing-Indicators-jh/

It’s for testing individual indicators, but the creator also made scripts for testing multiple indicators and full strategies. Of course, please note these particular scripts are specifically for testing with the rules of the NNFX strategy. But they can be modified to work with other strategies, and if you look around there’s a good chance someone’s already made a script for the strategy you want to test.

If you want to auto-test using MT4 you’ll be looking for EA’s. I don’t know much about those or where to get them but I get the sense they work similar to tradingview scripts. They shouldn’t be too hard to find if you just google terms like MT4, EA, backtesting etc.

Hope that helps!

1 Like

Hi :slight_smile: MQL5 website have big codebase, check it here. Regards Greg