MUST READ – How statistics can help in trading

statistics in forex

Statistics is a mathematical body of science that pertains to the collection, classification, presentation, interpretation and analysis of data. Sounds familiar? It should, because this is forex market all about. Statistics. Forex market is overall unpredictable but nevertheless predictable under certain conditions. What is true for long term picture might not be true for short term and usually this is the way things are. Statistics is a discipline that gives us an important edge when trading forex. This is not an article about statistics, it’s an article about how statistics can be useful in forex trading and what principles should always have in mind while trading.

1. Overall market movements can’t be predicted but under certain circumstances some movements can be predicted, that’s how profits are made. Of course 95% of traders lose their money but this happens only because they have no clue of what trading really is. Trading is statistics.

“Today EURUSD will go up” – this is a fundamental wrong statement, under any circumstances.

“EURUSD is likely to go up today” – this is the right statement. In forex we are not dealing with certitudes, we are only dealing with probabilities.

2. History tend to repeat itself. This is the most basic rule of technical analysis. In fact, if this hadn’t been true, nobody, and I mean nobody would have made profits from forex market. But fortunately, trading is not gambling and history tend to repeat itself. The past doesn’t repeat, but some aspects of it repeat over and over again. It’s up to us to spot them.

3. Any system can be profitable for a very short period of time. Even the most stupid system can be very profitable for a day or two but of course it fails miserably over a long period of time. And now is the time for the law or large numbers to be explained. According to to its definition Law of large numbers “is a theorem that describes the result of performing the same experiment a large number of times. According to the law, the average of the results obtained from a large number of trials should be close to the expected value, and will tend to become closer as more trials are performed.”

What exactly does that mean? A coin has two sides. If you toss a coin, the probability of coming up head and tail is 1/2 = 0.5 = 50%. If you toss a coin 10 times, anything can happen, you may even get 10 heads or 10 tails in a row even if the overall probability is 50% because the number of trials is simply too short and statistically not significant. But if you toss a coin 10,000 times things changes. You will get a result more close to overall probability of 50%, something like 4,999 heads and 5,001 tails.

How is the law of large number important in analysis of forex systems? First of all, it tells you that short terms results means nothing. Any bad system can product 10, 20 or even 50 wins in a row but nevertheless it is guaranteed to fail on the long run. For example, suppose that for 2 days there are no fundamentals at all. As a result, the market goes up and down  by 50 pips and support/resistance levels are not broken. If you buy when the market touches the lower level and sell when it touches the upper level you can make good profits..until the first high impact news hits. Same happens if the market trends. Keep trading with the trend and make great profits..until the trend ends. The long term robustness of the system must be first tested before using it live. A good system must be able to survive over unprofitable periods without many losses and win everything back plus much more during profitable periods.

4. Number of trades reflects the robustness of the system. Number of trades itself is not relevant if taken out of context. For example, let’s say we have a system that makes 1,000 trades per year. Is it a robust system? The answer is “we don’t know” even if the number o trades is large. Why? Because during one year it didn’t pass trough all market aspects.

  • If it makes 13,000 trades during 13 years and remains profitable by 13 x $X then yes, it’s a good system.
  • If it makes 13,000 trades during 13 years without profits, then it’s not a good system. It survives but it’s curve fitted for a single market aspect only.
  • If it makes 3,000 trades during 13 years and remains profitable it’s still a bad system. Why? Because if it didn’t trade during an unknown market condition, then it is curve fitted for a single market aspect only.
  • If it makes 13,000 trades and the profit doubles (I’m not mentioning anything about drawdown here), it means that it made $X during one year and $X during 12 years, a very unequal distribution of profits.

5. Any system can be profitable on backtests only if many rules are added to it. Adding multiple rules means curve fitting at it’s purest form. The system will fail on live trading because statistical relevancy is destroyed. Those rules may not be valid for future markets even if they worked in the past. Curve fitting by adding multiple rules is a trick used by commercial EA vendors. I can tell if the system is curve filled just be looking at its equity curve. Short term rules that don’t make sense on the long run are added just to hide the drawd0wn periods (for example “do not trade between 12.03.2007¬† and 30.04.2007”). If the equity curve points straight up then it’s the first sign of curve fitting, that’s why I like ugly looking equity curves clearly showing the drawdown period.

Statistical principles and methods are invaluable tools in forex, ignore them and get ready to fail. In the following articles I will explain two of the most used statistical methods that helps in testing the robustness of our systems: Monte Carlo and Walk Forward.

But first, a practical example might help. Statistics also helps in developing successful trading systems. Before thinking of a system, I need a clear look at long term picture. I need to know how many pips per day a certain pair moves. The chosen pair for this study is EURUSD. Using 13 years Alpari UK no holes data, here are my findings:

Between 0 – 60 pips -> 311 daysBetween 60 – 90 pips -> 850 days
Between 90 – 120 pips -> 847 days
Between 120 – 150 pips -> 586 days
Between 150 – 180 pips -> 326 days
Between 180 – 210 pips -> 214 days
Between 210 – 600 pips -> 286 days

By studying the table above I notice that the market frequently moves between 60 and 150 pips (850 + 847 + 586 = 2280 days out of a total of 3420 days which means 66%).

The first idea that comes into my mind is to trade pullbacks. For example, if the trend goes up, I wait for a small retracement then buy EURUSD (2 and 4 Elliot waves, my hope is to catch waves 3 and 5, please see the article about how forex market moves). But how long is the 2 or 4 wave? I don’t know that, so I let MT4 optimizer to find out the best option.

Go long rule: the trend went straight up the previous day (Close[1]-Open[1]>0) and the price retraces a certain percent of previous High – previous Low.
retracement_up=Low[1]+(percent*(High[1]-Low[1]));

Go short rule: the trend went down the previous day (Close[1]-Open[1]<0) and the price retraces a certain percent of previous High – previous Low.
retracement_down=High[1]-(percent*(High[1]-Low[1]));

Stop loss and take profit is not more than 150 pips each. Took me 20 minutes to code this system, here is the backtest:

backtest

backtest

After 30 seconds of watching the equity curve, I dismissed it from the start because it appears to be w0rking for one market condition only, please see my green square. It worked great between 2007-2009 and no so great the rest of the years. Maximum drawdown during 13 years is 2,000 pips and total profit is 10,000 pips.
10,000/13 = 769 pips on average per year for a maximum risk of 2,000 pips. So the reward :risk ratio is 1:3 which is quite bad, not to mention that past performance is not a guarantee for future performance. But history tend to repeat itself.

Now you see why statistics is so useful when it comes to forex trading?

Thanks for you time! If you enjoyed this article, please share the link. Knowledge and sharing is power!