Monday, January 30, 2012

Martingale Strategy

Fear constitutes the strongest emotion facing any forex trader. Fear of losing, in particular, keeps many in bed with one eye on the monitor while the other rests. Martingale strategies theoretically remove that problem by ensuring that a strategy always comes out on top.

The idea is to bet more after a loss, usually twice the amount of a previous bet. Let's do an example where the value of winning and losing is identical. We either win $10 or we lose $10.

The first bet puts $10 at risk. We start out on a run of bad luck, resulting in a $10 loss. Now we double the risk. We either get paid $20 or will lose another $20. We lost again. So far we are down $30. We double the risk again, so now we're either going to make $40 or lose another $40.

So far the strategy doesn't seem that bad. 3 losses in a row only occurs 12.5% of the time (0.5 * 0.5 * 0.5). This is as bad as it gets the majority of the time. But, for the sake of the example, let's continue.

We lose again. Now we're down $70. Double the risk to either make or lose $80.
Another loss. The floating loss grows to $150. The risk grows to $160.

You're no doubt noticing that the risk numbers are getting a little more uncomfortable. For the sake of making it clear how quickly they can get out of hand, I created a small table below.

Consecutive lossesFloating loss
6-$160
7-$320
8-$640
9-$1,280
10-$2,560

However, if tenth trade rescues the account, you earn back everything that you lost, plus the $10 that you originally attempted to earn. Although you sweat bullets during a cold streak, the strategy comes out on top the vast majority of the time.

Here is where the problems start to roll in. I did not say all of the time. In the real world, you do not have an infinite supply of money. If you have a $5,000 trading account and risk $10 on the first trade, then you can only withstand a maximum of 10 consecutive losses; you don't have enough money to make it to the 11th loss.

Measuring the payout of a Martingale strategy


Consider a game of coin flips where heads means that you win and tails means that you lose. The odds are 1:1, 50%, that you will win or lose on any given flip. Although the probability of winning remains constant at 50%, the actual distribution of those wins and losses will come in the form of hot and cold streaks. Tossing the coin ten times does not always result in 5 winners and 5 losers.

Throwing a coin 10 times will result in 10 consecutive wins 0.09% (0.510)of the time. Conversely, 0.09% of the time also results in 10 consecutive losses. So, the coin flips results in behavior that looks anything like a random outcome 0.18% of the time. The scenario that keeps us up at night - fear in forex trading never goes away - is that that unlucky streak of 10 winners will actually come to pass. 0.09% of the time occurs once in every 1,111 trials.

The next question to consider is the number of wins required to make this worthwhile. Everyone's goal post is different, but it's safe to assume that doubling the account balance makes anyone a happy camper. Earning $10 for a total of $5,000 means that you must have a total of 500 winning Martingale sets. Each set is the group of trades required to earn that $10. Sometimes, the first trade wins and that finishes the set. Sometimes it takes 7 trades. Sometimes (gulp), it takes 20.

500 winning sets requires 1,000 total trades. We get this number by dividing the winning sets, 500, by the probability of winning, 0.5. If the closeness of that number to the scary threshold of 1,111 jumps out at you, it should.

Remember that the evil 10th consecutive losing trade could possibly occur at any point at or after 10 total trades. It could occur after 100 trades or, very rarely, after 10,000 trades. On the whole, it will occur 0.09% of the time, although it will randomly cluster. No method exists to predict where.

Think of the issue graphically. Our hurdle of 1,000 trades to double the account constitutes the danger zone, or the bad space. The safety zone is only the total trades at risk, 1,111, minus the benchmark of 1,000, which is a safety zone of 111.

A graphic of the area of danger and safety within a Martingale strategy

As the sea of red danger zone relative to the green safety zone makes clear, the odds of coming out on top are not exactly in your favor. Specifically, you face a 90% chance of blowing up against a meager 10% chance of doubling your money.

Look for more fertile strategy strategy ideas and money management techniques. I like the simplicity behind Martingale, but that's about it. A simple mathematical analysis tells you that it's not going to end well the vast majority of the time. If you wish to continue a Martingale trading strategy, it only gets worse from this point forward.

Other Martingale problems



The odds are not really 50%. We assumed that the price either goes up or down. We forgot to consider the spread. Pairs like the EURUSD show a typical spread of 1.0-1.5 pips at most reasonably priced brokerages. That, unfortunately, affects the probabilities. The price must move an additional 1.5 pips to reach the exit point.

A Martingale system trading a 10 pip interval now must earn 11.5 pips to cover the 10 pips it risks. The wins will only occur 46.51% of the time instead of the theoretical 50%.

Moving the size of the pip interval does help bring the probability closer to 50%. A 25 pip interval achieves 48.54% accuracy, while a 50 pip interval yields 49.46% accuracy. Going further and further up the ladder gets closer and close to 50%. It never quite gets there, though.

The other assumption that we made is that markets are akin to tossing a coin. Well, that's definitely not the case. Although markets exhibit a high degree of randomness, they do show periods of time where they are distinctly non random. They are, in fact, fractal. Mandelbrot enjoyed stumping on the fractal nature of markets at every opportunity. The assumptions that we made with the coin tossing analogy do not always apply. I strongly recommend reading The (Mis)behavior of Markets if you're interested in a layman friendly explanation of the topic.