Have you ever backtested a system?

tommog

Well-known member
Messages
402
Likes
56
Hi all.

Im very interested in trying to build a mechanical trading system. The key reason for this is so you can backtest systems and get an idea of its success without risking capital.

I was wondering how hard it is to teach yourself how to programme a system?

Also what software did you use? I have heard of a free system called metatrader4. Free software would be very helpful obviously because it would be good to experiment with ideas without losing capital.

Many thanks in advance
 
I was wondering how hard it is to teach yourself how to programme a system?

Also what software did you use? I have heard of a free system called metatrader4. Free software would be very helpful obviously because it would be good to experiment with ideas without losing capital.

You will enjoy backtesting. If you know basic programming principles and Boolean Logic it is easy to use high level languages to back test simple ideas. For more complex ideas you must do some more work and have a little more programming skill.

Metastock is a good start for systems expressed with Boolean logic. Tradestation is much better for people with programming skills. So is Amibroker and Wealth-lab. Many other systems available.

Consider the simple system where you buy at the open of today if it is higher than the high of the previous day AND the close of the previous day is higher then the open of the previous day (trivial example, probably not good, just for illustration purposes)

Metastock formula code:

(Ref(O,0) > Ref(h,-1)) AND (Ref(c,-1) > Ref(O,-1))

you must also set the proper entry point and the exits in the options of the Metastock Tester.

Tradestation EasyLanguage code (For TS2000i version):

if o[0] > h[1] AND c[1] > o[1] then Buy this Bar on the open;

you must write additional code for your exit method.

Alex
 
You will enjoy backtesting. If you know basic programming principles and Boolean Logic it is easy to use high level languages to back test simple ideas. For more complex ideas you must do some more work and have a little more programming skill.

Metastock is a good start for systems expressed with Boolean logic. Tradestation is much better for people with programming skills. So is Amibroker and Wealth-lab. Many other systems available.

Consider the simple system where you buy at the open of today if it is higher than the high of the previous day AND the close of the previous day is higher then the open of the previous day (trivial example, probably not good, just for illustration purposes)

Metastock formula code:

(Ref(O,0) > Ref(h,-1)) AND (Ref(c,-1) > Ref(O,-1))

you must also set the proper entry point and the exits in the options of the Metastock Tester.

Tradestation EasyLanguage code (For TS2000i version):

if o[0] > h[1] AND c[1] > o[1] then Buy this Bar on the open;

you must write additional code for your exit method.

Alex

The key to any successful backtest is to also include money management in your algorithm and margin requirements. A pip-positive system may become £-negative with poor money management. You should also add a randomness to it to slip the odd pip here and there when opening/closing a trade for added realism.

If trading indices don't assume you can buy at the open price, always take the open + 5 mins figure.

Have fun - I guarantee you'll go through loads of systems before you find a viable one!
 
Keep in mind that Excel is something that you can use to do system testing. It requires less in the way of learning a programming language, but obviously it also lacks some of the bells and whistles that a package like Metastock offers. I've used Excel quite a few times becuase in some ways I can be more precise with that I'm trying to do and have the ability to more easily get right down in to the data.
 
Hi all.

Im very interested in trying to build a mechanical trading system. The key reason for this is so you can backtest systems and get an idea of its success without risking capital.

I was wondering how hard it is to teach yourself how to programme a system?

Also what software did you use? I have heard of a free system called metatrader4. Free software would be very helpful obviously because it would be good to experiment with ideas without losing capital.

Many thanks in advance

Hi Tommog,

ProRealTime is a free EOD charting package which has a programming facility.

As a newbie, I believe it is very important to undertake statistical analysis of a proposed trading strategy. You need to also define entry, exit, stop loss, position sizing and money management rules.

Naturally, past performance is no guide to the future. But, if a strategy is seen to have a positive expectancy in the past, this would give you confidence in your strategy (psychologically very important). Furthermore, you should also test the strategy in the real markets by risking very small amounts of money.

Good luck

Fibonelli
 
Hi Tommog,

Furthermore, you should also test the strategy in the real markets by risking very small amounts of money.

Good luck

Fibonelli


A very important point! A well backtested system with good performance can be ruined by the trader in the real world. When I was testing a mechanical trading system I used VB6 to simulate the trades and Excel to analyse the results.

Also, (IMO)...If it is too complicated to code then it's too complicated to trade. Keep it simple.
 
thanks everyone for the advice. A bit more about me...

I am a prop trader and so have been around the markets for a bit and know the sort of things im trying to do but have absolutely no programming skills at all. Im ideally looking for a decent system i can run outside my intraday trades, one thing i like about backtesting a system is that you can take a historical track record and show it to people that are willing to support you with decent capital which is the way i see the industry going as more and more intraday scalpers are finding they arent making money as computers beat them to it. So a longer term strategy that i dont have to monitor the whole time is ideal.

I have the ideas but no programming skills so i may even end up paying someone to programme what ideas i come up with. Interesting stuff...
 
Alllmy backtesting is in Microsoft Excel

I use data from unicorn and stockcharts.com as well as decisionpoint. Excel visual basic was easy for me because I first started out with extensive basic in my day job.

I have a freedownload available at my yahoo group as well as various entries in the file section discussing the program. the file you can download there is intended to let people establish for themselves the style & structure of what I do, as well as maybe help them by creating a frame for their own work.

http://finance.groups.yahoo.com/group/mvpsignalsystem/
 
I stopped a trader friend from back testing, because when I pointed out to him, he realised that his setup was really just a general rule of thumb that he traded price around and not a "rule".

I think there is far too much emphasis on backtesting as opposed to spending time with a setup to really learn it.
 
Back testing

Its value may well depend on who's doing it and what they are trying to accomplish. In my own case, the original goal was to target and catch the major selloffs which usually occur in the fall of each year in us mkts. From there I went on to design short signals, and various rebuy signals.

There are other folks who can just eyeball the chart and make the call.

In truth there are dozens of ways to approach investing and the only error we can all make is to think our way is the only one that will work.

At the end of the month and year, all that matters is the growth of your brokerage balance, if its not outpacing major successful broadbased mutual funds, the game is lost.
 
Last edited:
I stopped a trader friend from back testing, because when I pointed out to him, he realised that his setup was really just a general rule of thumb that he traded price around and not a "rule".

I think there is far too much emphasis on backtesting as opposed to spending time with a setup to really learn it.

I think backtesting can be both overemphasized and under-emphasized. By that I mean, sure no backtest can give you rock solid perfection going forward.

On the other hand, you can rule out any number of gambits that look good on todays chart, but fail when laid down year after year on the data.
 
Hi all.

Im very interested in trying to build a mechanical trading system. The key reason for this is so you can backtest systems and get an idea of its success without risking capital.

I was wondering how hard it is to teach yourself how to programme a system?

Also what software did you use? I have heard of a free system called metatrader4. Free software would be very helpful obviously because it would be good to experiment with ideas without losing capital.

Many thanks in advance


Tommog,

Having read through the many replies to your question, I would like to add my 2cents worth regarding which software packages to use.

Metastock, although a very good charting package is next to rubbish for backtesting as you can only test ONE security at any one time. In reality you will never trade like this and its results give a very false impression.

To overcome this, there is another piece of software out there called TradeSim which integrates very nicely with MS. TradeSim has Monte Carlo capabilities. If you are really serious about backtesting strategies, with the long-term goal of actually trading real money you need this IMO.

ProRealtime is another excellent charting tool, and comes free!!!!! (which is always a bonus). However, like MS its Backtesting features are very limited.

Personally, I use a combination of Amibroker (IMO Unbelievable powerful package at a fraction of the cost of MS) and TradeSim to carry out my backtesting.

I should point out that TradeSim Enterprise Edition is NOT CHEAP but then again if you are serious about Trading then its money well spent!!!

All the best,

Chorlton
 
Top