10 Simple Steps to Back Testing Effectively!steemCreated with Sketch.

in #trading6 years ago

2018-03-06_1606.png

Backtesting is the process of applying a trading strategy or analytical method to historical data to see how accurately the strategy or method would have predicted actual results.

Basically traders need to back test, or test theories on historical data to see what the markets have done in the past. If we find something that repeats over and over int he past, we can trade the same way in the future.

This is because humans do the same things day after day. We are creatures of habit and change doesn’t come easily. Therefore, we see the exact same scenarios all the time in the markets.

Nikola!

2018-03-06_1609.png

Nikola Tesla wanted to develop transatlantic radio and talked to his business partner, J.P. Morgan, a new means of instant communication. This new invention gathered stock quotes and telegram messages and sent them to his lab, where he would encode them and assign them each a frequency. This would broadcast to a hand held device.

Did Tesla envision a smart phone or wireless internet before its time?

This inventor tested, tested, and tested some more. As will all new breakthroughs in any avenue of life, people test things long before they ever work. This testing goes unnoticed until the day it comes about. No one ever sees this testing, all the hundreds of hours of calculating, sweating, worrying, dreaming about the testing, and the gut wrenching hard work that goes into anything we see today.

There is not one man made thing that has not been tested many times before it comes to market.

  • How many times did Henry Ford think about and test various versions of an automobile?
  • How many years did Colonel Sanders try before he hit the jack pot?
  • How many hours did TraderBot Marketplace test their auto trader before it was profitable?

I can’t speculate on the first 2 but I will inform you of the process we go through before releasing any signal or auto trader product to the market. You may have never even thought about how our systems come about but by the end of this section, you will know exactly how we do it and you will also be able to do it for yourself.

Step 1. Prepare for Disaster

On almost every situation, anything new, whether it is a trading product such as ours or any product produced by anyone, there is a lot of failure before the product comes about. Visionaries can see things that mere mortals can not and this is why they don’t let failure stop them. Nikola Tesla caused blackouts and blew up power plants on a regular basis. Within the TraderBot Marketplace creations, we have done some pretty stupid things in the past:

  • Ryan Herron created a trading strategy that was an ultimate failure with 0 wins and 29 consecutive losses.

  • Terry Cash tested an idea that looked promising, only to take a 2,400 pips loss due to a stop loss error.

  • Chris Arnold spent an entire month testing 8 hours per day to find out his idea was rubbish.

  • Matthew Renner accidentally gave out our source code to a project and we had to scrap the idea.

Failure and bad stuff happens with any new creation so expect it! If you can not deal with failure and trying something 1,000 times, then don’t even begin back testing.

With any new trading strategy that you are thinking about, maybe you will hit a winner your first time around but after all of the critical tests, it is highly unlikely. Rich banks and hedge funds hire people to find out what works and then destroy it so they can take over the market. Their goal is to take money out of your pocket so creating a strategy from scratch wont be easy.

Step 2. Put Your Ideas on Paper

My mom and dad used to tell me to write everything down. Regardless of what I am thinking about, if I write it down as I am thinking about it, I wont forget. Sometimes I wished I had written things down because many freakishly awesome ideas have flew out the window and I will never be able to remember them.

Now, when I have an idea, I don’t care if I’m in the shower and have to write it, while standing naked, on the mirror with lipstick, I’m writing that sucker down!

2018-03-06_1634.png

You will want to write down a basic idea and how you think it will work. All strategies are just things we make up anyhow so here is an example of something I may want to back test, ” How many times does a profit occur if the 20 period moving average cross the 50 period moving average over a period of 5 days?”

Once you have that written down, open up a chart and start scanning. The initial things you are looking for is FEASIBILITY. Does this thing look like it has potential while just scanning a few charts? You will find out that some systems can totally be scrapped at this point because they sound fine when you are thinking about them but once you look on the chart, you see a bunch of total garbage.

It’s OK to scrap a crappy idea. I have probably scrapped 10,000 ideas during my career. You will find one, however that looks great in your mind, looks good on paper, and looks good on the charts. When you find this, you can move on to step 3.

Step 3. Look back over 50 trades

Remember the strategy I spoke about in the section above ’20/50 Moving Average cross over 5 days’? I can tell you that at the time of this writing, on the daily USDJPY, this setup will hit a profit target of 80 pips, over 5 days 48.98% of the time. It has 3 consecutive winners and 6 consecutive losers over the past 50 trades. It hits a stop loss 42.86% of the time. These types of things are what you need to know when back testing. This information helps you make an informed decision.

How long did it take me to back test 50 trades? If you did it manually, it will take your hours and hours, literally. I actually timed how long it took me, 18 seconds, because I used the TraderBot Marketplace Tool Suite to get this done. By using a back testing software such as out Tool Suite, you can shave tens of thousands of hours from your testing time, over the course of your career. I can literally test 25 different settings on this moving average crossover in less than 5 minutes. Whether you decide to do it manually or use our Tool Suite, I don’t care. You just need to do it and know the following…

  • How many pips on average are possible?
  • Do you take multiple trades or just one?
  • How many consecutive wins or losses are there?
  • Does it work better during specific hours or specific days?
  • What assets does it work best on or worst on?
  • Will it perform better with a 10 pip stop, 100 pip stop, or range stop, etc…?
  • Does it work during news?
  • How do interest rates affect the strategy?
  • What margin is needed?
  • Can it be compounded?
  • How long does the average trade last?
  • Does it work better for long positions, short positions, or doesn’t matter?
  • ... And anything else you can derive from your trade setup!

Step 4. Try many ways to make it work

Once you have an idea that ‘looks’ good and you get all excited, you will want to try different types of scenarios to attempt to find the best possible setup.

Whether doing it manually or by using the TraderBot Tool Suite is up to you but the video shows myself testing various strategies in real time. If you back test like this, you are waaaay more apt to find a super profitable strategy.

I just back tested about 6 or 7 different strategies in less than 20 minutes, using thousands of example trades. Can you do this on your own? I can’t, that’s for sure. This is why I rely so heavily on my TraderBot Marketplace Tool Suite to help me test ideas. I could not live without it now because I use it every single day.

Step 6. Know when to scrap it and start again

This will be a short section. We often have an idea and hang onto it as if we are trying to save a drowning ship. Look, if something doesn’t work, it doesn’t work. Don’t stay with an idea if it doesn’t work. You can’t make it work. You don’t have enough money to move the market so drop the idea and move on.

Here is a tip. If you have a trading idea that sounds good but when you try to test it, the results are not that great, go ahead and spend the next week trying to make it work. If you can not make it somewhat profitable within a week, then it is just not going to work. If it doesn’t work and you continue to stay with it, you might be a little insane.

Insanity: doing the same thing over and over again and expecting different results; Albert Einstein (Who really knows if he said it or not but still it's a good quote.

 

Step 7. When you find a winning scenario, make small changes, not huge ones

OK so let’s pretend you find a strategy that seems to win over and over. You are now going to try to optimize the strategy.. but don’t over optimize because you will totally shoot yourself in the foot!

Definition: Optimize: to make the best or most effective use of (a situation, opportunity, or resource).

Let’s pretend you find a winning strategy.. or a losing one for that matter! You want to start to make little changes to see various outcomes. Look at a 25/55 moving average cross instead of a 20/50. Look at 24 bars out instead of 12. Look at a 20 pip profit target instead of a 10 pip target. Change ONE thing at a time and write down the results. Make small incremental changes and your success will go up faster.

If you decide that a 20/50 moving average dross for a 10 pip profit target at 12 hours out doesn’t work and you say something like, ” This is bull crap and doesn’t work so I’ll try a 14 period RSI for a 30 pip target 27 hours out…” then you will be doing yourself a disservice. You will be taking a strategy that may have potential and forgetting it. How do you know it doesnt work until you look at all scenarios?

DON’T OVER-OPTIMIZE!

If you find that a 20/50 cross doesn’t work and a 21/50…22/50…23/50…and 24/50 cross doesn’t work but for some reason a 25/50 does work, this is called over-optimizing. There may be some issue that causes it to work for a time but if you pick exact parameters like this, you are looking for failure.

Over optimization is a big fat lie. If a strategy works for a 20/50 cross, then it should either work a little better or a little worst at 21/50 and 19/50. There is no way, on Gods green Earth that one tiny parameter that miraculously works for some reason you don’t know, will continue to work in the future. Don’t over optimize.

Once you find a strategy that works, move on to step 8.

Step 8. Look back over 1,000 trades and multiple assets

You find something that works over the past 50 trades and now you want to look back over the past 1,000 (or as many signals as you can). This practice has only one reason. This is to find the absolute worst and best that a strategy has performed throughout history. If you have data that goes all the way back to the 1929 Stock Market Crash, then you will want to know the absolute worst possible scenario that ever happened.

Even if the worst possible scenario is large, this doesn’t mean that you r strategy is junk. For instance, let’s say that over the past 50 trades, you have a winning strategy but over the past 1,000 your draw downs are larger. At this point, you can start looking back 800 trades, 700 trades, etc… Find out when the strategy became unprofitable or less profitable. What you are looking for is the period of time when the strategy changed. Maybe a super huge news release came out. Maybe interest rates were changed. There are numerous factors that cause a losing strategy to turn into a winning one and vice versa.

Look at multiple assets. If you have been testing on the EURUSD, then also look at GBPCAD and USDJPY and even the Dow Futures or Gold. Look across multiple assets. Sometimes you may be pleasantly surprised to find that one particular asset is wildly profitable. All assets do not move the same way. Maybe your strategy works awesome on Gold but suck toes on Oil. It is always nice to find strategies that work on everything but this is extremely rare. Test everything!

  • How many pips on average are possible?
  • Do you take multiple trades or just one?
  • How many consecutive wins or losses are there?
  • Does it work better during specific hours or specific days?
  • What assets does it work best on or worst on?
  • Will it perform better with a 10 pip stop, 100 pip stop, or range stop, etc…?
  • Does it work during news?
  • How do interest rates affect the strategy?
  • What margin is needed?
  • Can it be compounded?
  • How long does the average trade last?
  • Does it work better for long positions, short positions, or doesn’t matter?
  • ...And anything else you can derive from your trade setup!

Once you have enough data and you are very happy with the results of your back tests, then and only then should you begins to demo test in the live market. You should never ever, never, not ever ever trade live at this point. Not yet! Never trade live without going through the process we have discussed here today and you will save yourself hundreds of hours of heartache and maybe thousands of dollars in lost money.

Step 9. Demo test in the live market

As you demo test, trade in the exact same way as you did in your back tests. Change absolutely nothing! If you do this, your results will be similar, in nature, of the results in the back tests. If you trade exactly the same over a period of 20 or 30 trades and the results are dramatically different, the go back to step 3 and step 8 and find out where the issue is. If your results are vastly different, then you most likely over optimized.

You are going to want to demo trade for at least 50 trades in the market, whether it takes you 2 months or 6 months. 50 demo market trades is the minimum acceptable demo tests. When you see the following picture, we followed these EXACT steps listed in this section and are now trading the strategy live. The demo results, shown below, matched the back tests almost identical so we moved to live trading.

2018-03-06_1643.png

Above, you can see demo tests for 600+ trades. Remember that 50 trades is the minimum. This is to ensure that the results equal the back tests. Once you have 50 trades, or more, under your belt, and they are relatively the same, then move to live testing.

Word Of Caution! Some people treat a demo account as play money and they start trading super huge amount like risking 50% of their account on a single trade. Don’t get sucked into this because pretty soon, your trading will just be a hobby and no longer a business. Treat every trade (back tested, demo, or live) as if it is real money on the line.

Step 10. Live test

Take a look at the following 2 screenshots. We were profitable in demo and now we are in live trading. The results look almost the same as the demo tests.

2018-03-07_1206.png

Now live test for a while. There is a formula that we follow to move from live testing into production trading.

  • Live test with 1 microlot, or the smallest trade size you can actually get entered into the market for 10 live trades.
  • Live test with 2 microlots or 0.25% of your account risk, on the next 10 trades
  • Live test with 3-4 micros for the next 10 trades
  • Live test with 5-7 micros for the next 10 trades
  • So on and so forth, until you move up the the risk level that you are comfortable with

Never ever jump from live testing with 1 micro lot to 10 standard lots. This is stupid and causes you to make mistakes. If you move from 1 micro to 2 and then to 3 and then to 5 and then to 7 and so forth, you will start to slowly get acclimated to the emotions of the wins and losses. If you jump from 1 micro to 10 standard lots, your emotions will play tricks on your mind. You will begin to do things irrational and make ignorant decisions that cause your wife to slap you across the face for losing the rent money!

If you start losing money in live trading, start lowering your lot size. If your live results are not behaving almost identical as your demo tests, go back to demo trading and find out where the issue is. Most likely the issue is inside your brain. Most likely you are making different decisions like moving your stop loss because the market ‘looks’ like its going to turn. You have got to treat live trading EXACTLY as your did in your back tests and demo, otherwise all of this testing is for nothing.

Slow and steady wins the race. If you get fast, you want it NOW, and get overly confident, then… well just watch this video…

Back Testing is the KEY to your long term survival in this crazy world of trading!

Now, it’s your turn. Do you back test or not?

Happy Trading!

imageedit_1_6822897959.png

Coin Marketplace

STEEM 0.24
TRX 0.11
JST 0.032
BTC 61166.56
ETH 2987.63
USDT 1.00
SBD 3.71