Manually Backtesting a trade idea.

Shikamaroo

Well-known member
Messages
305
Likes
20
I have decided to backtest a trade idea that i had, however i am no good at coding ea's and have found some shortcomings in the ea builders that i have found on the internet. I took too long to realize the importance of keeping excellent records but hope this has been a major step in the right direction.

Many people say that u must have an edge, however, i think that some traders like myself are uncertain exactly what that edge in raw percentages over a statistically significant number of trades. This in my view leads to the constant trade strategy research of many poor traders. I am hoping this test will help me stop that and prevent trade ideas from poping into my head.

My strategy is simple and takes place on the 1 min chart so feel free to stop reading here.
My trade idea is similar to it an occurs a bit more frequently. (thus the intrigue)

My idea for the backtest is to ignore time of day, FA's, time limits and moving stops and targets in the first phase. These would be added later if i determine that trading this way is feasible.
 
Why don't you just forward test it? That way you will actually get useful information about whether it will work or not. Forward test it on a demo account for a month or two, then try it live. Bear in mind that if it is a scalping system (which I am guessing it is since you use 1 minute charts) demo accounts may not be a good representation of real market conditions, as it may fill you on orders that wouldn't get filled live.
 
Forward testing is for if u're sure u have something, i think. I dont want to go in all gung ho, because, when the rose coloured glasses come off, I wanna be prepared.
 
may i ask where you got the price information from to backtest

i've been searching all over the internet for 1m data for the eur/usd but all i found was daily and only like a year worth or was exactly what i need but cost $200 USD

i want to backtest using MATLAB but i'm not really aiming to trade mechanically it's more out of curiosity hence my reservations about forking over $200 usd
 
i use metatrader for my backtesting needs. does no one think that backtesting a strategy makes sense?
 
it does.. but forward testing is the only way to be sure ... but backtest untell you sure it can pass a forward test...
 
I think backtesting is useful. Gives you an idea of whether the system is profitable or not but don't rely on it 100%, especially if you are trading on 1 min charts. If you can't code the EA yourself, get someone else to do it. I use freelancer.com to get my EA's coded. You should be able to get it done for about $30 if its pretty basic. Let me know how you get on. If you want to use that site I can recommend some programmers.

Sam.
 
Thanks for the suggestion megamuel.

Well, i ended up using January 2011 as the first testing period. I ignored time of day and FA's and ended up with mediocre results.
Number of trades - 155
(using stop 20 tp 20) yielded 77 profit 78 loss (49.6 win %) 49.6% profit rate
(using stop 20 tp 15) yielded 93 profit 62 loss (60.0 win %) 45% profit rate
(using stop 20 tp 10) yielded 102 profit 53 loss (65.8 win %) 32.9% profit rate

well posting this up i feel a bit silly to ask the next question.
Anyway, i was thinking that most of the best trades don't create a drawdown greater than 8 pips so i could probably improve the profitability by looking for a suitable exit between 5 pips and break even whenever the market gets below 10 (8+2 spread). i thinking i in denial but i doh want it to be so, wat allya think?
 
I'm able to code and backtest most strategies, with either a single market or a portfolio. I'm always curious to see new strategies, and have coded up backtests in the past for friends who want to know how their ideas test out. As such, I'm willing to code a strategy up for free (within reason) - but clearly my interest here is in seeing new ideas. Either way, I'm also prepared to discuss the algos I use, so feel free to PM me if interested.
 
I'm able to code and backtest most strategies, with either a single market or a portfolio. I'm always curious to see new strategies, and have coded up backtests in the past for friends who want to know how their ideas test out. As such, I'm willing to code a strategy up for free (within reason) - but clearly my interest here is in seeing new ideas. Either way, I'm also prepared to discuss the algos I use, so feel free to PM me if interested.

If I remember correctly, you use prorealtime?
How does their tick data compare to Dukas, or do you only test swing strats with them.
I'm currently forward testing atm, live as we speak to test for slippage / comms and execution delays (sms alert system - circa 20-30secs max - tickets already setup).

I know you can import Dukas tick data into MT4/5 (won't go into detail as probably be closed down if servers are flooded...)
Can you import 3rd party data into prorealtime?
 
If I remember correctly, you use prorealtime?
How does their tick data compare to Dukas, or do you only test swing strats with them.
I'm currently forward testing atm, live as we speak to test for slippage / comms and execution delays (sms alert system - circa 20-30secs max - tickets already setup).

I know you can import Dukas tick data into MT4/5 (won't go into detail as probably be closed down if servers are flooded...)
Can you import 3rd party data into prorealtime?

I use Amibroker, into which you can import pretty much anything. I've tested systems using short bars (15 minutes or less) and the most important aspect is the quality of the data. For example, eSignal FX tick data is useless, as it contains far too many erroneous highs and lows. The data from IB is good, but it takes forever to suck in to Amibroker. I have also used Disktrading for historical FX tick data, it seems to be decent.

Running backtests on futures data is more reliable, as that comes from an exchange and is less prone (or even not prone at all) to false points. I really can't stress the issue of data quality enough - a small amount of good quality data is infinitely better than a large amount of average quality data.
 
Thanks for the suggestion megamuel.

Well, i ended up using January 2011 as the first testing period. I ignored time of day and FA's and ended up with mediocre results.
Number of trades - 155
(using stop 20 tp 20) yielded 77 profit 78 loss (49.6 win %) 49.6% profit rate
(using stop 20 tp 15) yielded 93 profit 62 loss (60.0 win %) 45% profit rate
(using stop 20 tp 10) yielded 102 profit 53 loss (65.8 win %) 32.9% profit rate

well posting this up i feel a bit silly to ask the next question.
Anyway, i was thinking that most of the best trades don't create a drawdown greater than 8 pips so i could probably improve the profitability by looking for a suitable exit between 5 pips and break even whenever the market gets below 10 (8+2 spread). i thinking i in denial but i doh want it to be so, wat allya think?

Well first of all, what profit:loss ratio are you targeting? What do you mean by "profit rate"? How much slippage do you envisage if a trade is stopped out?

You need to move away from thinking about drawdown in pips. In fact, stop thinking in pips at all (pip size is relative to the market).. instead think about what percentage of your equity are you risking per trade.. then, once you've run the simulation, you'll be able to see max. drawdown in terms of account %.

Also, be careful about curve fitting.. try for a system with a maximum of 5 adjustable parameters.
 
I use Amibroker, into which you can import pretty much anything. I've tested systems using short bars (15 minutes or less) and the most important aspect is the quality of the data. For example, eSignal FX tick data is useless, as it contains far too many erroneous highs and lows. The data from IB is good, but it takes forever to suck in to Amibroker. I have also used Disktrading for historical FX tick data, it seems to be decent.

Running backtests on futures data is more reliable, as that comes from an exchange and is less prone (or even not prone at all) to false points. I really can't stress the issue of data quality enough - a small amount of good quality data is infinitely better than a large amount of average quality data.

With you on data quality, no personal experience, but MT tick data is a prime example
(non existant...just fills in the gaps from m1 bars).
Would you say Ami, as well as being accurate, is the most user friendly script language?
 
Well first of all, what profit:loss ratio are you targeting? What do you mean by "profit rate"? How much slippage do you envisage if a trade is stopped out?

profit rate is the same as profit to loss ratio. i just took the risk reward ratio and multiplied it by the win loss ratio for that small sample. I used a percentage because that's more familiar to me.

I used pips because i keep estimating 20 pips being equal to 5%. bad habit that i have to cut.
 
There is an EA called LFH Trading simulator (Its free, there are others that do a similar thing). It allows to to basically rerun old data and enter your trades just like it was real time. getting the data is difficult. Try this link for data http://www.forextester.com/data/datasources.html

Thanks for the suggestion. I had initially discounted this route since i want to know if trading my strategy would be viable in the long run and the simulator is slower than manual recording.

That said back testing is very boring and i fell off the backtest wagon and was looking at other ideas after the fist string of losers.
 
With you on data quality, no personal experience, but MT tick data is a prime example
(non existant...just fills in the gaps from m1 bars).
Would you say Ami, as well as being accurate, is the most user friendly script language?

I can't recommend Amibroker highly enough. For $280, it's an astonishingly powerful piece of software. In addition, the support is excellent. The reason I looked into it originally because, unlike many software packages, Amibroker handles simulations on portfolios. But more than that, it's the flexibility that makes it so useful. The other major plus point is speed; as a comparison, I would say it's 30-50 times faster than ProRealTime.

It does however require some work to become familiar with the coding language, if you're not already familiar with C. However, this is no different from any other high level application.
 
I can't recommend Amibroker highly enough. For $280, it's an astonishingly powerful piece of software. In addition, the support is excellent. The reason I looked into it originally because, unlike many software packages, Amibroker handles simulations on portfolios. But more than that, it's the flexibility that makes it so useful. The other major plus point is speed; as a comparison, I would say it's 30-50 times faster than ProRealTime.

It does however require some work to become familiar with the coding language, if you're not already familiar with C. However, this is no different from any other high level application.

Can't argue with the features:
http://www.amibroker.com/features.html
Looks like a steep learning curve, worth it though :)
 
Top