Moving averages crossover strategy

Best Binary Options Brokers 2020:
  • Binarium
    Binarium

    The Best Binary Options Broker 2020!
    Perfect For Beginners!
    Free Demo Account!
    Free Trading Education!

  • Binomo
    Binomo

    Good choice for experienced traders!

​Moving average crossover strategies

Moving averages are typically one of the most popular indicators for technical analysts. How can crossovers provide traders with opportunities in the market?

​Moving averages are often the first technical indicator traders will utilise when they set out attempting to understand how to trade. However, it is notable that those averages often remain relevant to highly competent traders, who have experience and knowledge of many additional tools. That highlights the importance these averages can play in the realm of technical analysis, with traders across the spectrum utilising them on a regular basis.

Types of moving average crossovers

Moving averages can be utilised in a number of manners, from providing support and resistance, to indicating potential turning points around crossovers. Each trader will have their own favourite averages, yet it is worthwhile noting two groups of averages: long-term and short-term.

Long-term moving averages

Long-term averages (eg 50, 100 and 200) are slow moving, providing less sensitivity to short-term price action than their short-term counterparts. Those long-term averages will typically provide fewer signals in any method of use, yet that relative rarity can also raise the perceived importance of those signals. Owing to the slow nature of these moving averages, there is a risk that signals can be relatively lagging in comparison to the short-term averages.

Short-term moving averages

Conversely, the shorter-term moving averages (eg 5, 10, 20, and 50) can provide a trader with a more active indicator, with recent price action providing a significantly greater. Signals are much more frequent, with the reactive nature of these averages meaning that signals can be timelier than the long-term moving averages. However, with more signals and reactive movement there can be a greater number of false signals.

When utilising a moving average crossover strategy, the key is to look at the shorter, more reactive average as a guide of what direction the market could be turning. It is worth noting that crossover strategies are typically more useful within a trending market, with sideways trade expected to bring buy and sell signals with little end product.

When it comes to choosing which moving averages to utilise, traders will undoubtably want to find the magic numbers that will somehow provide the consistent trade strategy that the others do not have. However, it is not the case that the more obscure combination is the best method, for this reduces the self-fulfilling element of this trading strategy.

Golden cross and death cross

Long-term moving average crossovers can often be labelled ‘golden’ and ‘death’ crosses, depending on whether they have bullish or bearish connotations. Let’s take a look at the death cross, with a 100 and 200 simple moving average (SMA) strategy.

This 100/200 combination highlights the strengths and weaknesses of a longer-term SMA crossover strategy. The USD/CNH chart below highlights this strategy perfectly, with the long-term nature of these moving averages ensuring that signals are few and far between. There are just two on this daily chart, which covers almost two years. Nonetheless, the lack of frequency ensures that there are less false signals.

Best Binary Options Brokers 2020:
  • Binarium
    Binarium

    The Best Binary Options Broker 2020!
    Perfect For Beginners!
    Free Demo Account!
    Free Trading Education!

  • Binomo
    Binomo

    Good choice for experienced traders!

The left crossover has seen the shorter 100 SMA break below the longer 200 SMA line, providing us with a sell signal. On this occasion we have seen it provide a great reversal signal, with the pair deteriorating heavily for the ten months that followed. However, the second crossover proves less successful, with the price having already moved sharply higher before the buy signal was produced.

This highlights the somewhat lagging nature evident with this type of strategy. If a trader was to await the opposite crossover to exit their first position, they would have given up most of their initial winnings.

Trading is often about learning from losers rather than only focusing on your winners. Thus, this example is useful as it can show you different strategies that can be used to mitigate such type of events. Firstly, when we are looking at the exit from position one, a trade could have utilised either the 100- or 200-day SMA as a dynamic stop-loss. A break through either of these major moving averages holds significant value aside from the crossover, and thus such a strategy could lock in profits earlier.

Secondly, looking at the two trade entry points, it is useful to see what makes one more successful than the other. The issue with the second entry is that the price had already moved significantly higher by the point of the breakout, raising the risk that the entry is too late. Thus there has to be some form of element which considers what stage of the market reversal we are within.

Generally, the further away from the 100-day SMA the current price is, the more the price is travelling at a faster-than-average pace. As such, entries where price is a substantial distance from either of these long-term moving averages could raise the risk of a late entry.

Short timeframe crossover signals

Next, let’s look at the strengths and weaknesses of a strategy based on short-term moving averages. The example we use below is the 10- and 20-day SMA on the same USD/CNH chart. This provides us with a very different type of trade signal, with the two moving averages tracking the price action much more closely. This provides us with a substantially higher number of trades, yet that also brings a higher number of false signals.

The sensitive nature of this form of crossover means that they typically do not operate well in a sideways environment, which generally provides a raft of unprofitable buy and sell signals. However, with that weakness comes the benefit of a significantly timelier signal when things do work out. Thus, it is easy to break down this chart into different phases, with the trending phase providing particularly profitable, while the consolidation phases prove particularly unprofitable.

Unlike the longer-term SMA crosses, the sensitive nature of this form of crossover allows for a timelier exit signal. Thus, profitable trades can be exited in a manner than can lock in profits to a greater extent than the long-term strategies.

Looking at how we could make this type of strategy profitable, the key here is being able to differentiate between the trending and consolidation phases. The main method we can utilise in this example is looking at the price action as the key gauge of whether we are within or breaking from a consolidation phase. The consolidation phase tends to provide us with peaks and troughs that differ from the typical lower highs and lower lows seen within a downtrend.

​Thus, when we see the consolidation phase in the middle, none of the bullish crossovers are joined by higher highs in price. Nor are the bearish crossovers accompanied by a lower low in price. With that in mind, the bearish signal only finally comes once the price breaks through support at ¥6.5683. This ability to marry up the price action with the signals of a shorter-term moving average crossover strategy provides a trader with greater accuracy and less false trading signals.

Alternate forms of moving averages

When looking at other potential crossover strategies, it is important to note that not all moving averages are made equal. While we have been looking at the simple moving average, the use of alternate averages can provide another approach to this technique. One such average is the exponential moving average (EMA), which gives a stronger weighting to more recent candles in comparison to those further back. As such, this will provide a more sensitive and dynamic signal compared with the SMA.

Three moving average strategy

Sticking with the EMA, the utilisation of multiple averages can provide us with a good mix of the long- and short-term moving average strategies. For a trending market, we should see these averages line up where the shorter moving average is closest to the price, and longer average is furthest away.

Taking any other combination as a signal that we are in consolidation phase, it means that we could utilise an EMA (more dynamic and relevant) in a manner which also allows for both short- and long-term elements to the trading strategy. Once again, it also makes sense to incorporate an element of price action into this triple EMA crossover strategy.

Moving averages crossover strategy

In 1988, University of Illinois economist, Scott Irwin, first published research in the Journal of Finance with co-authors, Lukac and Brorsen, refuting skepticism of trading systems based on technical analysis in U.S. futures markets. Perhaps unknown to Irwin, computer-based trading systems had been used by management firms like Commodities Corporation since the late 1960s. It was in the 1970s and early 1980s when (now well-known) traders Paul Tudor Jones, Louis Bacon, and Bruce Kovner, gained prominence and profit at the Princeton-based firm.

Inspired to design a simple rules-based system, I’ve developed an algorithm to trade on simple moving averages, confirming that a rules-based approach can be gainful, and established that even retail investors can adopt strategies alike.

Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month

Why choose IGM as the benchmark? Choose AAPL as the benchmark and see that one would have done better to just buy and hold. Buy and hold has about the same volatility (.34) higher Sharpe ratio (1.02) but does have greater drawdown (60.82%). Here’s the same algo but with the benchmark set to AAPL.

Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month

Thank you for pointing out Dan. I too noticed the drastic algorithm under-performance when setting Apple as the benchmark. Any insight into why trend surfing fell short of just holding long?

@Conrad, @Dan is right in his observation, and makes the right argument.

The reason why your trade slicing produces less than the simple buy & hold is that you get whipsawed at lot due to your lagging response to price change. The positive trades are not sufficient or large enough to compensate for this deficiency. A way of saying you need a better strategy design.

Here is the equation to follow: Σ(q∙Δp) > B&H = q_0∙[p(T) – p_0], which says that the sum of the sequence of trades (P&L) need to beat the buy & hold scenario which is simply making the initial investment (F_0 / p_0 = q_0) over the time interval (T – t_0).

@Conrad, what you presented is an all too frequent example of the sum of the parts did not exceed the whole. And also an illustration that Σ(q∙Δp) > 0 might not be enough.

Try this MAC AAPL-TLT strategy which 1.5 times outperformed Buy and Hold AAPL.

As always, I left some space for yours incredible ability to increase productivity 10x just changing one number.

@Vladimir, if I was dealing with just AAPL as in this scenario, I might just go, with hindsight, for some leverage, and see the strategy literally fly.

I took @Dan’s trading interval, and restructured AAPL and TLT’s participation.

Not one, but 3 numbers. The total outcome: $ 1.7 billion with higher volatility and drawdown evidently. Note that the leveraging expenses would have been more than paid for with that kind of performance.

The presented equation said: Σ(q∙Δp) > B&H = q_0∙[p(T) – p_0]. You need the outcome of your trades to exceed the profit that could have been had holding the stock. There are a lot of trade slicing combinations that could do that, just as there are a lot that would not succeed.

Here, I simply applied some leverage: 1.6∙Σ(q∙Δp).

Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month

@Vladimir, there is also that if you wanted more, you could do even more of the same.

This exercise shows that it could have been done, had someone had the determination and conviction to execute such a plan. AAPL has been doing good for many many years. Besides, we all knew that it was to the present day. And the bet should be that AAPL will continue to do so.

Using leverage in this case would have been this show of determination, of conviction in what we all think was a stock that had good future prospects and should have seen its price rise over the trading interval.

Just in case you had even more conviction. Again, the same 3 numbers were changed.
Outcome: $ 4.4 billion. Leveraging expenses, almost trivial considering, but still substantial.

Note that instead of using an in or out scenario, I used a partial out with a partial move to bonds. The reason is simple. You have a 55.5 day moving average that has a lag of 27.75 days. Like saying you are quite late to the party. Nonetheless, it does provide a “regime” switch even if it is not that good.

@Dan showed that there was nothing in the original script, and he is right. Its regime switch had no value, in the sense that it did not outperform a buy & hold.

Now, with the partial switching, some of the AAPL shares will be sold after a top, and repurchase after a bottom. Sufficiently to pump and dump part of the inventory at every MA crossing. The result, the bet size, on average, will be increasing. Also, most of the leveraging will be on what is declared as the rising part of the price movement.

Since the MA crossing was often wrong, you still continued to benefit from not having sold all your AAPL shares. Thus, the excess return. Nothing seems to beats the big bet on the big thing. But even here, the big bet (putting it all on one stock) appears reasonable, and might even be considered acceptable.

Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month

@Vladimir, hope my last post was sufficient to fulfill your request:

“As always, I left some space for yours incredible ability to increase
productivity 10x just changing one number.”

You must have noticed the change in strategy behavior. It is not due to the program’s logic since it did not change. As a matter of fact, none of the trading points have been changed. Trades are initiated at exactly the same times as @Dan’s script. It is a trading strategy that could be done by hand. It certainly is not complicated.

The change in performance is due to putting the pressure where it can count, on the bet size. See its payoff matrix: Σ(H∙ΔP).

Those 3 numbers changed the nature of the program from a run to safety on any sign of price weakness proposition to a trading strategy with a core position over which some trading takes place.

The 55 and 56 SMAs smooth out the data, but at a cost of being late by some 5+ weeks. Nonetheless, it provided an in and out signal, even if it was wrong a lot of times, and having whipsaw issues in consolidation areas.

The strategy’s logic flow resembles the following chart which has been posted here before:

Instead of totally switching to bonds, part of the AAPL inventory is sold after a top (at the SMA crossing), it is done by reducing the leverage. From there, switching part of the portfolio to bonds even if the move is not that rewarding.

The SMA’s crossover declares the uptrend where bonds are abandoned to put more pressure on the upswing. If there is a place to put some temporary leverage on, it is at the bottom near the start of a potential upswing.

All done with 3 numbers !

My point being, a lot of trading strategies on Quantopian operate on the on and off switch when maybe trading over a core position might produce better results.

We all have to explore to then settle with what we find acceptable.

We design trading strategies and operate them as if their logic was set in stone. Those 3 numbers showed that changing a strategy’s behavior over time can also be quite productive. Even more productive than changing the strategy’s trading logic.

There is a lot more finesse that could be added to this script. But, I would prefer a total redesign to gain control over those numbers, and provide the strategy with more refined objective functions.

Hope it helped in some way.

You not only met my expectations but exceeded them.

BTW Conrad and Dan started their back tests from 2002-03-15.
The early date you may start yours 2002-03-22
I run it from the date.
From tear sheet below I see:

Annualized Specific Return 45.36%

As I understand this new artificial metric it is a good number.

But there are Risk Factors which need attention:

technology 1.82
momentum 1.30
size 5.30
value -1.13

Do you have any idea how to neutralize them without loosing the only real metric – return?
Do you think they need to be neutralized?

How did you call “ma_crossover_handling” in rebalance before ever defining it??

@Vladimir, sorry about the start date mishap, being dyslexic, I often do errors like that.

But, it does not change the strategy. Had @Conrad and @Dan used the same start date, we would all have had the same SMA 55-56 crossings and therefore, the same decision points.

You raise interesting questions. We started with a trading strategy that makes some profits because at times it is in the market in a stock that is generally rising. So, we should have no surprise in the fact that it did make some money. @Dan showed that performance is also something relative, and that, whatever trade slicing used, a strategy should at least outperform a simple buy & hold.

Since I was using the same decision points. I gamed the strategy. I rigged its on-off betting system so that from a switcheroo strategy it morphed into a core position (APPL) over which on-off excess leveraging was performed.

Here are the important points from your tear sheet.

Yes, CAGR through the roof. At a cost.

Drawdown: 55.8%. Slightly more than the SPY over the same period. But, not much. Mr. Buffett had slightly over 50% drawdown too over the same period. Notice that APPL is about 20% of QQQ, it could be classified as a bellwether stock.

Gross Leverage: 1.59. Was allowed 1.0 to 1.9. Averaging out to 1.59. Note from the Exposure chart that the leveraging is really on and off based on the SMA crossing which would be the same for anyone using the same lookback periods.

You can go for leverage only if your trading strategy can pay for it and then some in order to show a net profit from using it.

Portfolio Allocation Over Time does show how much of a switcheroo strategy we have. But, this serves as the strategy’s protective measure. You can accept to put leverage on rising prices, but not on declining prices where it would hurt your portfolio. It is also why you can add some leverage, if it is to be applied at the start of a potential upswing, even if at times you get it wrong.

Daily Turnover, in magnitude, is being reduced over the years. The reason is simple, your core position is getting bigger and bigger. As a consequence, the daily turnover tends to have less impact.

Daily Trading Volume shows that with time, the number of shares traded does increase substantially. Again, the reason is simple. The switcheroo thingy forces to almost double-up its core position which is growing to ever higher levels.

Transaction Time Distribution is a deception. All trading orders are sent at 9h31. And it takes all day for trades to fill. And based on the look of it. It does not succeed all the time, meaning that quite a proportion is rejected. Notice that it has the same kind of distribution as what we see as daily trade distributions for hyperactive stocks. The reason it takes all day, and that at every minute there could be some trades is mainly due to TLT. 30% of the core equity is too much to handle under the 2.5% of volume rule.

However, you do not really need TLT to trade at all. Its only purpose might have been to provide the mechanics for a switcheroo haven. But, that is handled by the SMA crossing. As a matter of fact, if you had zero trades in TLT, you would have about the same performance level, if not better. Put the downside AAPL leverage at 1.0, and TLT at 0.0, and it will add $60 million in profits.

Cumulative Common Sector Returns Attribution chart shows that all is in Technology. Evidently. We are also mostly playing momentum. What else should we expect? This betting system trades one stock and will accentuate its beta and volatility on its upswings.

To answer your last two questions. To partially reduce the impact of trading a single stock, you simple need to add other stocks. But, this might reduce overall return. As you try to average things out, that it be by diversification, or out of sync momentums, you will be dampening volatility.

This strategy wins because we did put emphasis on its volatility and did put more pressure on its upside volatility moves. Pumping at each step for bigger and bigger bets while switching all the time to safer grounds at the slightest sign of a downside price move.

We are in it for the money, and it is a CAGR game, where time, and return can have a major impact. The questions should be: what is the difference between: 1M∙(1+0.10)^20, 1M∙(1+0.50)^20 and 1M∙(1+0.60)^20? And, how much volatility can we support?

There are many ways to reduce portfolio volatility. Q is all about reducing it. But the money is made embracing volatility since by definition we need: ΔP > 0 to make a profit. The how we get it is just a matter of choice and determination.

Trying to find ways for ΔP to escape its short-term zero tendency: E[Δp] → 0, is what this game is all about.

Can these techniques be applied at a diversified portfolio level? The answer is yes. Should you want to investigate further, see for instance:

pipschart

Making profit fast with Forex Market

Gold Strategy : Moving Average Crossover

Gold Strategy : Moving Average Crossover

The Gold Strategy Moving Average Crossover or Golden Cross is a trading technique that relies on the use of moving averages in the most volatile times of the trading session. It presents the best results during the sessions in London and New York.

Moving Average trading strategies is simplest form work based on the intersection of two moving averages, in which case an open position when the fastest average approaches and crosses the slower average as shown in the following example:

There are multiple versions of the use of moving averages as a strategy to generate profits in the market. Using this technique we will show how to maximize profits and minimize risk by using these indicators.

The logic behind this technique is that during times of high volatility markets are at their best as they move with the greatest strength in accordance with the prevailing sentiment. During that time we will use a simple strategy with 5 moving average crosses special to show clear submit higher reliability.

System Rules

  • We use five exponential moving averages (EMA).
  • EMA periods are: 10, 20, 30 and the values ​​of 144 and 169 Fibonacci.
  • The first entry occurs when the EMA 10 crosses the two slower EMA (144 and 169 periods). In this case, the direction of the position (long or short) is the same as presented crossing moving averages.
  • The second entry is the main trading. A position is opened after a price correction along with the intersection of 20 and 30 EMA on the slower periods EMA (144 and 169 periods).
  • The target price depends on the type of chart.

Example of Gold Strategy Moving Average Crossover

  • The blue lines are moving averages of 10, 20 and 30 periods.
  • The red lines are moving averages of 144 and 169
  • The red circles indicate the points where there was crossing the EMA 10 with the EMA 144 and 169 and then crossing the EMA 20 and EMA 30 with 144 and 169 first.

Buy signal

  • 1st buy entry when the 144 and 169 EMA (red lines) crosses below the faster EMA 10 (red line) and price close above the cross.
  • 2nd buy entry after a price correction along with the intersection of 20 and 30 EMA (red ines) on the slower periods EMA (144 and 169 periods).
  • Stop loss set latest lower pick below the cross.
  • Profit target should be 1:1 or 1:2.

Sell signal

  • 1st sell entry when the 144 and 169 EMA (red lines) crosses above the faster EMA 10 (red line) and price close below the cross.
  • 2nd sell entry after a price correction along with the intersection of 20 and 30 EMA (red ines) on the slower periods EMA (144 and 169 periods).
  • Stop loss set latest higher pick above the cross.
  • Profit target should be 1:1 or 1:2.

Here the example of Gold Strategy Moving Average Crossover buy and sell entry rules:

Points to Remember

    • Just be patient.
    • But the crossing occurs not enter the market.
    • The golden cross occurs only when the EMA 10, 20 and 30 cross the EMA 144 and 169 periods.
  • Use levels Stop Loss and Take Profit according to the time frame in which it is trading. Follow the plan with discipline.
Best Binary Options Brokers 2020:
  • Binarium
    Binarium

    The Best Binary Options Broker 2020!
    Perfect For Beginners!
    Free Demo Account!
    Free Trading Education!

  • Binomo
    Binomo

    Good choice for experienced traders!

Like this post? Please share to your friends:
How To Make Money on Binary Options Trading
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: