Backtesting Guide

4 replies

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

11 years ago #110882

I ran across this in my files and thought it might be of help to others. It is a report on doing better backtesting. Hope it helps you in some way.

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

11 years ago #120840

thank you, I think people will find this guide useful.

Mark

Mark
StrategyQuant architect

0

Jonathan

Subscriber, bbp_participant, community, 5 replies.

Visit profile

11 years ago #121108

thank you, I think people will find this guide useful.

Mark

Stearno, Mark,

Contributing to peoples understanding of backtesting here are the rules that work for me after years of backtesting

1. Rigourous & Realistic Backtesting!

 

1.1 Need to Get clean data at one tick for currency pairs (use a broker with good historical data!) then keep upto date (history centre on Mt4) plus remove errors between time frames with spread cleaner script. Doing this will ensure the minimum of mismatched errors and a good modelling quality. Watch out for taking strategies with poor modelling quality <90% or multiple missmatched errors.
I also standardise on tesing using 1% risk and 10k account

 

1.2 Need to set realistic spread look at your brokers average & max spread for given pair by hour it is quite revealing
especially when one uses lower time frame strategies – EURCAD spread flat at 25 points 00 until 2100 then jumps to
between 30 and 90 until midnight GMT – Use Mt4i spread changer script to set spread for your strategy at each backtest.

1.3 Strategy needs around 100 trades to be statistically significant – e.g. if your daily trade EA does only 12 trades in one
year and makes 30% there is a risk that this is not representative of the market .

1.4 Need to test strategy over 3 to 12 months

This is an interesting one since the EAs people build are often less relevant on current markets. So backtest over the
last 2 years optimise then test over last 3 months if still good then go fwd if not then look at optimising and then
retesting over the last year(s) and see if still makes sense. This raises the question on how to optimise / judge an EA2. 2.

1.5 Avoid curve fitting optimisation this is a sunject on its own – quick tip watch out for going down increasing precision on optimisation e.g on an envelope strategy trading long on bottom and short off top say period is 10 and envelope is 0.15 finding that a better envelope is 0.152 gives 50% better results may be deluding yourself what you will really get.

 

2. Criteria for assessing I use Net profit % / RDD% looking for ratios greater than 3 and steadily rising equity curves over the period. I avoid EAs optimised with RDD> 10% or EAs with flat equity curves for 9 months of the year then rocket up.
Take note of number of consequtive losses and max RDD form report on the backtesting.

 

3. How to know if the EA you have backtested and set live is still relevant to the market you are trading

Everything you do on automated trading using EAs has to be fact based
So you have applied all the above and you notice that the RDD Or the number of consecutive losses on the results on your

live testing exceeds the results of your backtesting – Then stop the EA!. And go back to looking at optimisation Or the
fundamental strategy.

 

A comment here for Mark – in building and running safe EAs using fact based decisions it would be useful to be able to set in EA Wizard rules max consecutive losses and or max RDD.

 

 

Jonathan

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

11 years ago #121112

Jonathan,

I like what you said.  Thank you for sharing.  Kept some points in the top of my mind.

 

-Stearno

0

Jonathan

Subscriber, bbp_participant, community, 5 replies.

Visit profile

11 years ago #121116

Jonathan,

I like what you said.  Thank you for sharing.  Kept some points in the top of my mind.

 

-Stearno

Stearno I would appreciate your comments on this,

 

Backtesting Issues and Importing Custom Indicators

 

An issue that I and other users will come across as they import their preferred Indicators into Customised Indicators is:

 

1. Should I import the mq4 or ex4 if I have both ?  

Use mq4 it provides all the user settings into your strategies automatically

 

2. If ex4 is only available can you import the indicator? Yes  – however if you want to change the indicator’s settings away from default then you will have to recreate all the indicators settings and outputs manually.

look at indicator’s inputs in mt4 then replicate the input names (exactly and in same order) into EA Wizard.

 

3. when you backtest check that the EA is responding as expected in Mt4 

    3.1 Open the open chart so you can see the orders placed

     3.2 If no orders check the journal for errors

 

How to solve errors such as  subwindow -1 error which occurs with oscillator type indicators that are not in the main price window but appear in subwindows in Mt4

 

I have imported 10.2 TMA Slope 1.4 to build a trend retracement strategy and can not get the indicator to work – I believe this version of TMA slope has minimum repaint issues on h4 or D1 

 

Jonathan

0

Viewing 4 replies - 1 through 4 (of 4 total)