back test .. what to learn what to use

Discussion in 'Automated Trading' started by KK0701, Sep 7, 2011.

  1. KK0701


    firstly I am very new ... so newbie that I only realised that back-testing is necessary before you can ever put the money in. I am using meta trader 4 and want to back test channel breakouts on spot forex. I tried to manually write down all the entry exist prices and time, but just by finishing 6 years USDCHF, it took me almost one day. So I realised I need to use some programming stuff to help me.

    could anybody share some ideas with me? sorry that if my question is so basic..
  2. You have to learn how to do some basic programming. That is all.
  3. KK0701


    thanks for your reply.

    where should i start? could you share me some most relevant books or website to start with ?
  4. lubba


    all you have to do is the logic works, many would help you with the programing side. from what i read is you need an custom indicator for your own developed trading strategies. same goes with me, but for some reason programing are not suit me, so i ask help other online forum member.
  5. Hi Guys,
    KK/Luba - saw both of your points about development and have a couple of points for you.

    First of all, if you're learning from scratch don't use MT4, go the cAlgo route (easier to learn)
    Second, be careful with your back testing there are a couple of nuances of back testing that most people just don't 'get' - it's a really simple point but for some reason most people either choose to ignore it or just choose to misunderstand it.

    When you run an algo or indicator in live you get a price stream from your provider. However, due to latency you will not get all of the ticks that are provided by the liquidity provider (if you're watching EURUSD and there are 7+ updates a second how many of them are you getting - 3-4?).
    When you back test you do get every single tick - so in real terms back testing is how you would like the live environment to work but due to latency it does not.
    This means that your algo will not run the same in back testing and live modes (the level of discrepancy can be little or a lot). The back testing price feed also doesn't take into account the provider messing with the spreads (especially if you're being b-booked).
    The effect of this is that you might get SL triggered in some cases where in live it doesn't happen or you might miss a TP in live when it was hit in back testing.

    You also need to consider what time frame you're using - do you need tick data or do you need bar data?
    Another thing to consider is that for an algo the longer it works in back testing the less likely it is to work in live - yeah I know WTF?
    Algos are normally good for a few months before they need modifying (change params or tune variables for example) - so if you have an algo that works brilliantly for one month but crap for 6, if you alter your algo to work well for 6 months you should find that your 1 brilliant month results are watered down - so the rule we always use is back test to prove a theory over a good length of time but in terms of providing results that warrant further investigation use the last months tick data and tune for that (effectively tuning for current market conditions).
    and use parameters where possible, it will save you recompiling the code every time you make a change.

    Hope this helps,