Moving Averages Archives - Trading Heroes https://www.tradingheroes.com/tag/moving-averages/ Discover Your Grail Trading Strategy Wed, 05 Jun 2024 21:19:19 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 https://www.tradingheroes.com/wp-content/uploads/cropped-white-color-32x32.jpg Moving Averages Archives - Trading Heroes https://www.tradingheroes.com/tag/moving-averages/ 32 32 How to Create a No-Code, Automated 50-200 MA Crossover Strategy https://www.tradingheroes.com/no-code-automated-50-200-ma-crossover/ Thu, 30 May 2024 21:25:35 +0000 https://www.tradingheroes.com/?p=1025485 Learn how to build a fully automated 50-200 moving average crossover trading strategy, backtest and optimize a strategy.

The post How to Create a No-Code, Automated 50-200 MA Crossover Strategy appeared first on Trading Heroes.

]]>

The 50-200 Moving Average Crossover is an easy concept to build a trading strategy around because the inputs are simple and the potential optimizations are straightforward.

So it's perfect if you're just getting started with trading strategy development.

Many trading websites will give you what they say is the “best” 50-200 crossover strategy.

Interestingly, most of them don't give you any data to back up that claim.

I'm going to give you information that's much more useful.

In this tutorial, I'm going to show you how to backtest any Moving Average Crossover trading strategy on the internet to find out for yourself, if it really works or not.

Using this method will also allow you to test your own optimizations to see if you can improve on the strategy.

The best part is that you can use this method to backtest strategies very quickly because the backtests will be 100% automated.

You don't need to know how to write code to do this, it's all drag and drop.

I'll also show you some of my own backtesting results so you know good places to start with building your own strategy, and what to avoid.

Alright, let's get into it…

What is the 50-200 Moving Average Crossover Strategy?

This trading strategy is also known as a Golden Cross and Death Cross.

That's way too much drama for me, so I'm just going to call it the 50-200 Moving Average Crossover trading strategy.

As the name suggests, this strategy uses the 50 and 200 Simple Moving Averages (SMA).

Here's what that looks like on a chart.

Moving Average crossover on chart

The 50 SMA is considered the “fast” SMA because it reacts faster to price changes.

So naturally, the 200 SMA is the “slow” moving average because it takes awhile to react to price.

Basically, traders who use this method buy when the 50 crosses above the 200 and sell when the 50 crosses below the 200.

Sounds pretty easy right?

Well, not quite.

There are a few more things that have to be defined to make this a complete trading plan.

First, I'll create the trading plan, then I'll show you how to do an automated backtest of the plan, without writing a single line of code.

The 50-200 Crossover Strategy Trading Plan

Here are the rules for this plan:

  • Buy
    • Buy on the close of the candle when the 50 SMA crosses above the 200 SMA
    • Stop Loss at last swing low
    • Risk 1% per trade
    • Take profit at 1R (1 times risk)
  • Sell
    • Sell on the close of the candle when the 50 SMA crosses below the 200 SMA
    • Stop Loss at last swing high
    • Risk 1% per trade
    • Take profit at 1R (1 times risk)

Remember that this is just a starting point.

Any of these settings can be changed and retested. 

So do a couple of tests with these settings, then feel free to experiment with your own settings.

Get creative.

You never know, you might just develop a super profitable moving average crossover trading strategy.

How to Build the Automated Strategy

Now let's get to work.

For this backtest, I'm going to use NakedMarkets.

It's the easiest way to build automated trading strategies with no-code.

Once you complete these initial setups, you'll be able to test all of your 50-200 moving average crossover trading strategy ideas easily.

Create the Core Rules

The first step is to create the Core Rules.

This is what will tell NakedMarkets how to identify the initial setup conditions for a trade.

You have to create one Rule for long trades and one for short trades.

This will also be true for most of the other types of Rules.

Here's how to setup your first Core Rule:

  1. Open NakedMarkets and go to: Rules > Rule Manager
  2. Click the New Rule button in the lower left corner of the window
  3. Name the Rule in this format: [strategy name] Core [long or short]
  4. Select Core as the Rule type
  5. Click OK

Now it's time to add conditions to your new Rule.

Long Trade 

Let's setup a long trade.

To add a criteria, click the (+) symbol in the upper right corner of the screen.

From there, drag the conditions you want to use from the list on the right.

Add condition to NakedMarkets

These are the settings for each of the boxes, from left to right:

  1. Moving average: Period (50), MA Type (SMA)
  2. Greater than
  3. Moving average: Period (200), MA Type (SMA)
  4. And
  5. Moving average: Period (50), MA Type (SMA), Previous Bar (1)
  6. Less than
  7. Moving average: Period (200), MA Type (SMA), Previous Bar (1)

The reason that I'm putting 2 moving average comparisons in there is because I want to evaluate the position of the 50 SMA relative to the 200 SMA for the current candle and the previous candle.

I want to see the previous candle have the 50 below the 200 and the current candle have the 50 above the 200.

This will give me every situation where the 50 has just crossed above the 200.

If I don't do this, I will get a signal every time the 50 closes above the 200 and that would not work.

This is what your screen should look like after you're done.

Long Core Rule

Click on the Save Rule button in the lower left corner to save your Rule.

Now I'm going to do the same thing for the short side.

Short Trade 

Here's how to setup the Core Rule for a short trade.

The easiest way to create a new Rule is to clone the long trade and just change the settings that apply to a short trade.

To clone a Rule, right-click on the long Rule in the list on the right side of the screen and select Clone Rule.

Clone NakedMarkets Rules

Then right-click the cloned Rule and rename it.

Change “long” to “short” in the name.

So in this example, the new name of your short trade will be: “MA Cross Core Short”.

Now it's time to change the settings of this Rule to look for short trades.

This is what the short Rule looks like:

Short Core Rule

Here are the settings for each of the boxes, from left to right:

  1. Moving average: Period (50), MA Type (SMA)
  2. Less than
  3. Moving average: Period (200), MA Type (SMA)
  4. And
  5. Moving average: Period (50), MA Type (SMA), Previous Bar (1)
  6. Greater than
  7. Moving average: Period (200), MA Type (SMA), Previous Bar (1)

Click on Save Rule in the lower left corner to save your Rule.

Great work, you just completed the hardest part of this tutorial!

There are 2 more steps that you have to complete before you can start testing this strategy, so let's keep going.

Create the Entry Rules

Now that you have the Core Rules that will identify the basic criteria of the entry, it's time to create the Entry Rule that will determine the details of each entry, such as the entry type, stop loss, risk per trade and stop loss.

To do this, go back into the Rule Manager and click the New Rule button in the lower left corner of the screen.

Again, we will start with the long Rule, then clone it to make the short Rule.

Long Rule

Name your long Rule: “MA Cross Entry Long”.

Here's what your long Entry Rule will look like:

Entry trade long

For the order type and lot size, double click on the box to change the settings.

With the other boxes, drag the appropriate Default Rule from the upper box on the right side into the stop loss and take profit boxes.

Here's how to set that up:

  • Instant Order: Buy
  • Stop Loss: Last swing low
  • Take Profit: 1R
  • Lot Size: 1%

Click on the Save Rule button in the lower left corner to save your Rule.

Short Rule 

MA cross short entry

Now clone the long Rule and use these settings to create the short Rule:

  • Instant Order: Sell
  • Stop Loss: Last swing high
  • Take Profit: 1R
  • Lot Size: 1%

Click on the Save Rule button in the lower left corner to save your short Rule.

Create the Setup Rules

Alright, these are the final Rules!

Don't worry, this step is super easy.

A Setup Rule basically ties everything together and monitors your chart to see if the Core Rule criteria is present.

If it is, then it executes the Entry Rule.

Long Trade 

Go back into the Rule Manager and click the New Rule button in the lower left corner of the screen.

Create a new Setup Rule, then name it: “MA Crossover Setup Long”.

Setup Rule long

First, drag the Core Rule you created from the User Rules section into the top Setup Condition box.

Under Actions, drag the Entry Rule you created into the Actions box.

Now clone this long Rule and rename it to create the short Rule.

Short Trade

Setup Rule short

Replace the Setup Condition and Action with the short trade versions of your Rules.

That's it for Setup Rules!

Run the Backtest in Visual Mode

That was pretty easy right?

Now here's the fun part, you're going to actually backtest this strategy.

You should do this step first, before using Fast Backtest because it will allow you to see any errors that you made when creating your Rules. 

Close the Rule Manager and go back to the main NakedMarkets screen.

Start a backtest by going to File > New Backtest.

New backtest

Name your backtest, then select your starting balance.

Click on Next.

Backtest 1

Select the market(s) you want to include in the test, then click on Next.

On the next screen, you can select the timezone you want to use.

I usually use the default settings, so if you aren't sure about your timezone, just use the default settings.

Click on Next.

Select timezone

Now click and drag both the long and short Setup Rules that you created onto the chart.

You'll see these Rules that you're currently using in the upper left corner of the screen.

Add setup to chart

Select the right timeframe that you want to backtest on.

The timeframe shown above is the daily chart.

Then click on the Play button in the toolbar to start the backtest.

Play button in NakedMarkets

If you setup your Rules correctly, you'll see the trades automatically execute on your chart.

Watch the trades carefully to be sure that they are executing correctly.

Now if your trades are not executing correctly, see the section below on troubleshooting.

However, if they are working, then congratulations, you have just build your own automated 50-200 Moving Average Crossover trading strategy!

Once the backtest is completed, you can see the detailed stats by doing the following:

  • Save the backtest by going to: File > Save Backtest
  • Go to: Statistics > Statistics Center
  • In Stat Center, go to: Source > Import from backtest
  • Select the backtesting file you just saved

This will show you the stats on your backtest.

A word of caution here…

You probably won't have a super profitable strategy on the first try.

However, remember that this is a process and your results could be significantly better if you use different settings or run it on a different timeframe or market. 

You might get better results on the EURUSD 4-hour chart, or the SP&500 1-hour chart.

The return might be better if you use a different stop loss or change the moving average settings.

Again, don't get discouraged if your first test doesn't work out.

Remember that this will require some work and very rarely will even professional traders gets an awesome result on the first try. 

Therefore, be willing to experiment and treat this process like an inventor would.

Many times, inventors have to try many different prototypes before they get something that works well.

It's been said that Edison tried 10,000 ideas before he invented the light bulb.

Hopefully you won't have to try that many strategies before you find a good one, but you have to be willing to potentially stick it out for that long.

Regardless of the return on your first test, once your strategy is working in Visual Mode, now it's time to shift your backtesting into high gear.

Hit “Turbo Boost” and Run a Fast Backtest

Now that you're confident that everything is working correctly with your moving average crossover strategy, it's time to take your backtesting to the next level.

In this step, you're going to unleash “turbo mode” and use the Fast Backtest feature in NakedMarkets.

This will allow you to backtest multiple markets and timeframes, without having to setup each backtest individually.

To do this, go to: Tools > Fast Backtest

Then select the market(s) you want to backtest.

You can test as many as you want.

Click on Next.

Fast backtest step 1

Next, choose the timeframe(s) you want to backtest.

Again, you can select multiple timeframes.

Click on Next.

Fast backtest 2

Now select the Setup Rules that you want to backtest.

Select the moving average crossover Rules that you created above, under Setup Rules.

Click on Next.

Fast backtest step 3

Then you'll see the list of Fast Backtests that will be run.

Click on Launch to start the backtest(s).

Fast backtest 4

Once a backtest is finished, you'll see the basic statistics in this window.

There is also a link to the detailed stats in the [Load stat] link.

Load stats link

Click on the link to open Statistics Center and you'll see the complete results of each backtest.

MA cross results

As you can see, this test on the daily chart didn't work well.

But at the same time, it wasn't completely terrible either.

At least it was profitable for a period of time.

Losing 4.25% from 2006 to 2024 is also essentially breakeven.

So this strategy could be improved by using different settings in the strategy.

Again, this is a process and don't get discouraged by poor results on your first tries. 

Troubleshooting Your Rules

Even with a simple trading strategy like this, it's possible to make mistakes in the Rule creation process.

This is especially true when cloning Rules.

I actually made couple of mistakes when creating this tutorial.

So if your strategy isn't working as you expected, don't worry.

Just go back through the steps above and double check your Rules.

The most common mistakes are:

  • Not changing the greater-than or less-than criteria.
  • Having the wrong trade direction (buy or sell)
  • Using the wrong settings for an indicator

If you cannot see the error by just looking at the Rules, then there are 2 more things you can to do troubleshoot your strategy.

First, in your Setup Rules, change the Action to Pause Backtest, instead of using the Entry Rule as the Action.

This will take the Entry Rule out of the equation and allow you to only focus on the Core Rule.

Right-click on your chart and select: Detach all Rules.

Then drag your new Setup Rules onto your chart and run the backtest again in Visual Mode.

Every time the trade sets up, the chart will stop.

This will allow you to double check the logic of the Rule.

If your Core Rule is working correctly, then the mistake should be in your Entry Rule.

To test this, simply use the Entry Rule by itself by dragging the Rule from the list on the left of the screen onto the chart.

Add Entry Rule to chart

You can do this at any time, you don't necessarily have to wait for your entry criteria to be met.

This will open a trade and allow you to see if your Entry Rule is working as expected.

These methods will allow you to debug your trading strategy.

Stay calm and go through your Rules step-by-step.

If you cannot find the problem, head over to the NakedMarkets Forum and ask for help.

Potential Improvements

If you didn't get the results you were looking for in your backtests, here are a few ideas on how you can potentially improve your results:

  • Change the period of the moving averages
  • Use different types of moving averages, like an exponential moving average
  • Test different timeframes
  • Adjust the settings on the last swing high/low indicator
  • Test different markets
  • Use a different stop loss level
  • Use a different take profit level
  • Trail your stop loss
  • Risk more per trade
  • Risk less per trade
  • Add another indicator to create a second entry criteria
  • Use a strategy across multiple timeframes or markets at the same time to potentially increase profits and diversify risk

But don't stop there, what else can YOU think of?

Backtesting Results

All of this is great in theory, but how well does this strategy actually work?

That's what you're going to find out in the following links.

I'm going to backtest different ideas around this trading strategy, starting with the method described above.

The version above will be version 1 and I'll create a new version every time I make a change to the original strategy.

Rules for new versions will be available via the links below.

As I do new backtests I'll add them to the appropriate pages.

You'll see all of the stats for each backtest.

Even if a backtest doesn't do incredibly well, it can give you a starting point for creating a strategy of your own.

These tests also show you what to avoid and will save you time in the testing process.

Here are the versions that I've currently tested:

Conclusion

So that's an easy way to do a fully automated backtest of the 50-200 Moving Average Crossover strategy.

This is a great method to build a trading strategy around because it's so simple and provides many opportunties for optimization.

But remember that you must backtest every trading strategy yourself.

You cannot rely on my results or the results of anyone else.

To develop real confidence in a strategy, you must see hundreds or even thousands of trades, and test many different ideas.

Luckily, NakedMarkets speeds up this process dramatically.

I've given you the template…now get to work.

You can get a discount and some fantastic bonuses for NakedMarkets here.

If I missed something in this tutorial, let me know here.

 

The post How to Create a No-Code, Automated 50-200 MA Crossover Strategy appeared first on Trading Heroes.

]]>
50-200 Moving Average Crossover Strategy v1 Backtesting Results https://www.tradingheroes.com/50-200-ma-cross-strategy-v1-results/ Thu, 30 May 2024 21:24:57 +0000 https://www.tradingheroes.com/?p=1025547 See backtesting real results for the first version of the 50-200 Moving Average Crossover trading strategy. Detailed stats included.

The post 50-200 Moving Average Crossover Strategy v1 Backtesting Results appeared first on Trading Heroes.

]]>

In a previous article, I showed you how to create a fully automated 50-200 moving average crossover trading strategy, without coding.

Now I'm going to show you the backtesting results of that strategy for every market that I've tested.

I'll show you both the good and bad.

You have to backtest this strategy yourself to make sure that you're comfortable with it and that it actually works with your broker.

Even if a strategy doesn't work well, you can test ideas on how to improve it and make it much more profitable.

Now let's move on to the trading plan and the results for each market.

Remember: This is only a starting point for YOUR trading strategies. This is for informational purposes only and the results below will not guarantee successful trading. 

As I backtest new markets, I'll add the results to this page.

Bookmark this page and check back periodically if you want to get future updates.

The 50-200 Crossover Strategy Trading Plan

Moving Average crossover on chart

Here are the rules for this plan:

  • Buy
    • Buy when the 50 SMA crosses above the 200 SMA
    • Stop Loss at last swing low
    • Risk 1% per trade
    • Take profit a 1R (1 times risk)
  • Sell
    • Buy when the 50 SMA crosses below the 200 SMA
    • Stop Loss at last swing high
    • Risk 1% per trade
    • Take profit a 1R (1 times risk)

Be sure to read the full 50-200 Moving Average Crossover automated strategy tutorial to learn how I did these backtests in just a few minutes, without coding.

Backtests

EURUSD

Weekly Chart

On this timeframe, there isn't enough data to pursue this strategy.

With only 10 trades, you simply won't get enough trades to make this viable.

EURUSD W 50-200 Crossover

Daily Chart

This actually looks pretty good.

True…the return is very low, but the max drawdown is also low and the strategy stayed profitable throughout the entire test.

So this could be a good strategy to optimize, or trade in multiple markets, assuming that the results are favorable in those markets too.

No guarantees obviously, further testing would have to be done.

EURUSD D chart 50-200

4-Hour Chart

This strategy was profitable for most of the testing period, so this could be a good timeframe to start experimenting with.

Yes, the return was breakeven.

But the graph is more promising than most of the others on this list.

It executed 209 trades, which is decent.

If this works in other markets, then the combined return could produce a significant return.

Again, backtest this for yourself.

This is only meant to be a starting point.

EURUSD 4-hour results

1-Hour Chart

The return on this strategy was breakeven, so there is potential to possibly optimize this timeframe.

On the upside, the strategy did execute quite a few trades.

EURUSD 1-hour 50-200 moving average crossover results

30-Minute Chart

The results on this timeframe are not worth examining further, at least with this version of the strategy.

EURUSD 30m

5-Minute Chart

The results are terrible on the 5-minute chart, so no further analysis is necessary.

EURUSD 5min backtesting results

AUDUSD

Weekly Chart

Not enough trades here to start using this timeframe.

AUDUSD weekly results

Daily Chart

This could be tweaked because the results are breakeven. The biggest issue is that there aren't very many trades, so I wouldn't pursue this one.

AUDUSD daily results 50-200

4-Hour Chart

Another breakeven result, so it might be something worth tweaking.

AUDUSD H4 50-200 crossover chart

1-Hour Chart

Breakeven again. Maybe it's worth a few tweaks, but I wouldn't spend a lot of time on it.

AUDUSD H1 results

30-Minute Chart

Pretty terrible results, so probably not worth messing with. Move on.

AUDUSD M30 chart backtesting results

5-Minute Chart

Just like with the EURUSD, the 5-minute chart is completely useless, so this is not worth exploring.

It pretty much blew out the account.

audusd m5 results

Notes and Observations About this Strategy

So far, the lower timeframes are showing much worse results.

Therefore, it might be better to stick to the daily and 4-hour charts.

Also, the stop loss on this strategy may not be ideal.

Sometimes the stop ends up being too far away and it takes awhile for price to hit the target.

More testing and optimization would have to be done.

Learn how to build and tweak this strategy and test your own ideas and you might come out with better results than me.

Conclusion

So that's how this strategy stacks up in all of those markets.

I'll be adding new backtests as I do them, so be sure to bookmark this page and check back periodically to see if I have any new markets.

Remember that you should always backtest a strategy for yourself. 

Never rely on the results of others, including me. 

To learn exactly how I created an automated program to do the backtests above, WITHOUT coding, read this tutorial.

 

The post 50-200 Moving Average Crossover Strategy v1 Backtesting Results appeared first on Trading Heroes.

]]>
Exponential Moving Average Strategy (with Results) https://www.tradingheroes.com/ema-strategy/ Wed, 14 Sep 2022 09:08:44 +0000 https://www.tradingheroes.com/?p=1022079 Learn a super simple Exponential Moving Average trading strategy that can be tested in a few minutes. It's perfect for beginners.

The post Exponential Moving Average Strategy (with Results) appeared first on Trading Heroes.

]]>

There are several different types of moving averages out there, but my favorite is the Exponential Moving Average (EMA).

In this beginner's guide, you'll learn what the EMA is, how it works and the results of a super simple trading strategy that uses the EMA.

The Exponential Moving Average shows the average closing price of the previous candles over a specified period of time. It gives more weight in the average to the most recent closing value, and therefore has less lag than the Simple Moving Average. 

I could start by giving you the formula for how to calculate it, but that's boring and overly complex.

If you really want to know how the formula is calculated, I'll provide that towards the end of this guide.

But let's start off with something way more practical.

What is a Moving Average?

A moving average is a graph of the average closing price of a market over the last X number of candles/bars.

Let's use a setting of 10 as an example.

So on a daily chart, the current moving average value would be the average of the closing prices of the previous 10 days.

On a hourly chart, it would be the average of the closing prices of the last 10 hours.

When you're trading, you'll often see the number of candles used in the calculation in parenthesis.

It looks like this:

MA (10)

The Difference Between an Exponential Moving Average and a Simple Moving Average

A Simple Moving Average (SMA) takes the sum all of the closes in the range and divides that number by the number of candles in the range, which is 10, in the example above.

Here's what it would look like in a spreadsheet.

The number in the bottom right corner is the average of the closes from the last 10 days.

SMA calculation table

An EMA does something similar, but it gives more weight to the closing price of the most recent candle.

Therefore, it lags less than the SMA.

Here's how that looks on a EURUSD daily chart.

SMA vs EMA
Chart by TradingView

As you can see, the EMA stays closer to the current price than the SMA does.

This is why I prefer to use the EMA…most of the time.

You can also use the the open, high or low, instead of the close, to calculate the EMA.

Here's what it looks like when I put the open, high, low and close EMAs on the same chart.

Open, high, low, close EMAs

Interestingly, the EMA of the open and the close are almost identical.

But the most commonly used price point is the close. 

Why the EMA is Useful

The EMA smooths out the complex price movements on a chart and gives us one simple line, which we can use to develop trading strategies.

This line shows us the overall trend of the market and gives us a reference point to take trades. 

When the EMA is used as a trend indicator, pullbacks into the EMA can be great places to enter trades, or add to an existing winning trade.

Here are some examples of where you could have opened buy trades on the NEM chart.

This chart uses the 50 EMA (blue) and the 20 EMA (green).

Notice how using EMAs with different settings can help us take advantage of different phases of the trend.

When the trend is weaker, the 50 EMA gives is 3 buy points, as shown by the blue arrows.

As the trend accelerates, the 20 EMA becomes more useful and gives us one entry at the green arrow.

Entry points on NEM chart

EMAs can also be used in conjunction with other indicators to create countertrend, or against-the-trend, trading strategies.

Here's an example of a 100 EMA on a gold chart, paired with the RSI indicator.

Notice that when RSI goes overbought or oversold, price tends to move back towards the EMA.

This is an example of a countertrend EMA strategy.

Gold chart with moving average

Which EMA Setting Should You Use?

The setting you use will depend on the length of the trend you want to identify.

If you want to find longer term trends, you'll include more candles in the moving average.

Something like a 200 EMA is a common setting that traders use to identify a long term trend.

Here's a 200 EMA on the BTC daily chart.

200 EMA on Bitcoin chart

As you can see, the 200 EMA smooths out the downtrend and allows us to see that the long-term trend is down.

For a short-term trend, you'll use a lower EMA setting. A frequently used EMA setting is 20.

This is what the 20 EMA looks like on a chart.

Rivian Chart

The 20 EMA on this RIVN chart shows that the short-term trend is up.

So if you want to capture long term trends, use a higher EMA setting.

If you want to trade shorter term trend, or you want to place trades in fast moving markets, use a lower EMA setting.

Traders use variations of the settings, depending on the type of market they are looking for and what their backtesting has shown to work.

Obviously, there are many potential settings that you can use.

But let's take a look at an actual trading strategy and the settings that are commonly used with this strategy.

I'll also show you the backtesting results from using these settings.

EMA Crossover Strategy

A well-known moving average trading strategy is to trade when a faster moving average crosses over a slower moving average.

For example, the Golden Cross and Death Cross are often mentioned in the mainstream finance media.

This method usually utilizes the SMA, but the concept is exactly the same.

Here's a chart of the S&P 500, showing the Death Cross that occurred in March.

The purple line is the 50 SMA (faster) and the gray line is the 200 SMA (slower).

S&P500 Death Cross

So when the 50 SMA closes under the 200, you sell.

When the 50 SMA closes above the 200, you buy.

If you have an existing position, you close it out and enter a trade in the opposite direction.

Obviously, there are more details that need to be added to make this a complete trading plan.

So here's a trading plan that I created and tested in NakedMarkets, using the 50 EMA and 200 EMA, instead of the SMA.

Like I said before, I like the EMA better because it tends to be more responsive to price changes.

You can use almost any platform to backtest this strategy manually, including MT5. But NakedMarkets makes it much easier.

Entry

  • Go long when the 50 EMA closes above the 200 EMA. Place the stop loss below the last swing or below the 200 EMA, if there is no obvious swing.
  • Go short when the 50 EMA closes below the 200 EMA. Place the stop loss above the last swing or above the 200 EMA, if there is no obvious swing.
  • 2% risk per trade.
  • 1 entry per signal, 1 trade at at time.

Here's an example of a short entry, with a stop loss (red line) above the swing level before the crossover.

Stop loss example

Trade Management

Set the stop loss to breakeven, once the trade is profitable by 1R.

Exit

Wait for price to hit the stop loss, or the EMAs to cross over in the opposite direction.

EURUSD Daily Chart Results

I tested this trading strategy on the EURUSD daily chart, from 2004 to 2022.

This is a really easy strategy to backtest and can be completed in just a few minutes on the daily chart. 

Here are my results…

EMA crossover results

As you can see, this method didn't trade too often.

But it's really good at riding strong trends when it does take a trade, logging a 34.53% gain on the best trade. 

This trading strategy is super simple and a great starting point for beginners. 

The test was done with zero optimization and used the settings that are freely available on many websites and in YouTube videos.

Therefore, you can do some analysis of the strategy to see if there ways that you could improve the results.

You could experiment with different EMA settings, moving the trade to breakeven sooner, and testing this on different timeframes.

Although this strategy only averaged about 5.71% per year, imagine if you had 5 to 10 markets or timeframes that you trade this on.

That can add up to a solid yearly return. 

So get to testing and find the markets, settings and timeframes that work for you.

You might want to try the 4-hour chart next. It's also very easy to test and you can see your results quickly.

USDCAD Daily Chart Results

I also tested the USDCAD on the daily chart from 2006 to 2022.

USDCAD Golden / Death Cross backtesting results

These results weren't as good as the EURUSD results, but it was still profitable.

So there is some potential here and should be explored further. 

I noticed that I missed a couple of huge trends because the strategy exited at breakeven.

A re-entry rule could be added to catch these trends.

There's also the potential to split each trade up into 2 parts, taking some profit on the initial move, then leaving the rest to run.

I'm just giving you a starting point here.

Again, try different settings and timeframes on the USDCAD.

It's up to you to test, improve and master this strategy. 

Why is the 200 EMA Important?

The 200 EMA is often used to determine the long-term trend of a market. 

If price is below the 200 EMA, that's often seen as bearish, and if price is trading above the 200 EMA, that's bullish.

Traders who use the 200 EMA will usually only look for shorts is price is below the EMA and only look to buy if price is above the EMA.

It's often used when trading stocks, but can be applied to any market.

But remember, always test first!

The Exponential Moving Average Formula

Alright, if you've made it this far, then you must really want to know how to calculate the EMA.

So here it is…

EMA = k x C + P

k = 2 / (n + 1)

n = Number of days included in the EMA calculation, or the EMA setting

C = Current closing price – Previous EMA

P = Previous EMA

This can be a little confusing, so I'll break it down for you.

Weighting Factor Explained

The weighting factor is k. This gives more weight to the current closing price, based on the number of periods used in the settings.

So if there are more days in the EMA calculation, the current closing price will have less of an effect on the current EMA value.

If there are fewer days, the current closing price will have more of an effect.

Let's start by looking at how a 10 period EMA affects the k value, versus a 200 period EMA.

k = 2 / (10+1) = 0.18

k = 2/ (200+1) = 0.01

In the case of the 10 EMA, the current price has 18% or 0.18 more weight in the moving average than the other 9 data points.

Since there are more data points in the 200 EMA, the current closing price has a smaller effect and only has 1% or 0.01 more weight than the other 199 data points.

Putting it All Together

When the weighting factor is multiplied by the difference between the current closing price and the previous period's EMA value, you're simply giving more weight to the current EMA value.

Finally you add in the previous EMA value to get the current EMA value.

Final Thoughts on Trading with the EMA

The Exponential Moving Average is a great indicator to use to build trading strategies.

I've given you one way that you can use the EMA to trade.

But now it's up to you to test this trading strategy and make it your own.

The secret to successful trading is learning a strategy that works, then customizing it to your unique personality. 

So if you would like to move forward with this EMA crossover trading strategy, the next step is to start backtesting.

I've created this backtesting guide for beginners that will help you figure out your favorite settings and which markets/timeframes this strategy works in.

Remember that just because the strategy worked in the examples above, does not mean that it will work in all markets and with all timeframes. 

You HAVE to backtest. 

But backtesting is a process of discovery and can be a lot of fun.

Now get to work!

The post Exponential Moving Average Strategy (with Results) appeared first on Trading Heroes.

]]>
Golden Cross vs Death Cross Differences Explained https://www.tradingheroes.com/difference-between-golden-cross-and-death-cross/ Mon, 25 Jul 2022 10:04:01 +0000 https://www.tradingheroes.com/?p=1021662 Learn the difference between a Golden Cross and a Death Cross. Find out how to get alerts and figure out if they work in your market.

The post Golden Cross vs Death Cross Differences Explained appeared first on Trading Heroes.

]]>

golden vs death cross

When you buy something through one of the links on our site, we may earn an affiliate commission.

Two of the best known technical trading setups are the “crosses,” or the Golden Cross and the Death Cross.

They are used to signal the potential start and end of long-term uptrends and downtrends. This technical analysis method is usually used on the daily chart.

A Golden Cross and a Death Cross are opposite signals and occur when the shorter term moving average crosses over the longer term moving average.

The most commonly used moving averages are the 50-period Simple Moving Average (50 SMA) and the 200-period Simple Moving Average (200 SMA).

Keep reading and you'll learn the specifics of each crossover and see examples of each cross in different markets.

You'll learn how to get Golden Cross and Death Cross alerts on your computer or smartphone.

Most importantly, you'll also learn how to backtest these crosses to see if they actually work in the markets you trade (no coding needed).

Golden Cross Explained

A Golden Cross occurs when the 50 SMA crosses above the 200 SMA. 

This suggests that the market is entering a long-term uptrend.

Examples of Golden Crosses

Here's an example of a Golden Cross in Bitcoin.

After the cross, the market went on a big run.

Golden Cross Bitcoin

This is another example on the AT&T chart.

Golden Cross in T stock

It's very easy to spot a Golden Cross, once you know what to look for.

Death Cross Explained

Conversely, a Death Cross occurs when the 50 SMA crosses below the 200 SMA. 

This is a clue that the market could be entering a long-term downtrend.

Examples of Death Crosses

Here's a Death Cross in the Nasdaq, which signaled the beginning of a bear market.

death cross on nasdaq

Another chart showing a bearish cross on a AUDUSD chart.

AUDUSD death cross

Now that you know what these crosses look like, the next question is…

Do These Moving Average Crosses Really Work?

Most of the research around moving average crossovers has been done in the stock market.

This is a study that I found particularly interesting because they tracked both Golden Crosses and Death Crosses across multiple US stock sectors.

As you can see, trading these crosses worked out well during the bull market between 2009 and 2018.

They also did a longer-term study over 20 years, and the results were also profitable.

Moving average crossover bull market
Source: FactSet

However, there's a twist to this study…

Instead of selling short on a Death Cross, they actually went long. 

They found that this method generally outperformed the Golden Crosses in a bull market because they were entering the uptrend on a pullback.

So although a moving average crossover is a super simple concept, there are many variations that you can experiment with.

Some of them might work better than the basic strategy.

When These Crosses Don't Work

Just like with everything else in trading, a Golden Cross or a Death Cross does not a guarantee a profitable trade.

There will be periods where the market goes into consolidation phases and that's when you can lose money.

Russell 2000 whipsaw

Here's an example of this in the Russell 2000.

If you took every trade on this chart, you would end up with a net loss.

So be aware of the market you're trading and if price action starts to get choppy, it's best to pause and re-evaluate.

Optimize Your Entries

There are several ways that you can optimize your entries and make your trades more profitable.

Here are 2 ideas that you can experiment with…

Trade a Pullback

Instead of buying or selling exactly when the crossover happens, you can look for an area of support or resistance after the cross to enter a trade.

For example, instead of going long exactly at the Golden Cross on this gold chart, you could wait for the support level to form at the orange line.

Then you could buy below the orange line to get a better price than if you entered at the crossover.

As long as price stays above the 200 SMA, your trade has a good chance of working out. A good place to put your stop loss is at, or slightly below, the 200 SMA.

This entry method will also give you the opportunity to get in late, if you missed the original signal.

Buy at support level

It would be the same idea in a downtrend, except you would be looking for resistance after a Death Cross.

Ride the 50 SMA

Here's a classic trend following method…

After a cross, you could also trade a retracement to the 50 SMA.

This entry will cause you to lose out on some profits, but it will also help ensure that you're in a strong trend.

For example, here are a few long entries that would have worked in the S&P500.

Ride the 50 SMA

First make sure that the 50 SMA is above the 200 SMA.

Next, wait for price to drop below the 50 SMA, then close back above it to enter a long.

Then trail your stop loss is a way that you feel comfortable with. A great place to start would be a close below the 50 SMA.

Again, it would just be the opposite in the case of a downtrend after a Death Cross.

In order to find out if these ideas will work in the market you trade, you'll have to backtest.

Here's how to do that…

How to Backtest Golden and Death Crosses

Let's get real, most trading strategies don't work in all markets.

So you'll have to do some testing to figure out which markets work with these moving average crossovers.  

Since these moving averages are so easy to setup, you can quickly backtest them in any market and on any timeframe.

Backtesting is essential because you want to know that the strategy has worked over a long period of time, which will give you confidence to take trades. 

If you're new to backtesting, then read my backtesting guide for beginners to get started.

NakedMarkets is a great software for backtesting strategies, especially if you don't know how to code.

The first thing you should test is the basic version of the strategy. 

For a long, do the following:

  • Enter a long when the 50 SMA crosses above the 200 SMA
  • Exit the long when the 50 SMA crosses below the 200 SMA

For a short, do the following:

  • Enter a short when the 50 SMA crosses below the 200 SMA
  • Exit the short when the 50 SMA crosses above the 200 SMA

From there, test the optimization ideas listed above.

If there's a market that you want to trade with these setups, then it's time to create alerts so you don't miss any signals.

How to Get Golden Cross and Death Cross Alerts

Alert on phone

There are a few different ways to get alerts for these setups on your laptop or mobile device.

However, the easiest way that I know of is to use TradingView.

They have a ton of markets available, so there's a very good chance that they have a chart for the market you trade.

Since your alerts are hosted on their servers, you don't have to worry about keeping your computer on all the time.

It's easy to setup alerts, which will ensure that you don't miss any signals.

First add the 2 moving averages to the chart.

Click the Indicators button, then click on Moving Average.

TradingView moving average indicator

Now you'll see the moving average on the chart.

Double click the moving average line to pull up the settings.

Here are the settings for the 50 SMA.

50 SMA settings for Golden / Death Crosses

Add another Moving Average and change the Length to 200.

200-period moving average for connors rsi 2

Then right-click on the 50 SMA and select Add alert on MA.

Add alert to moving average

On the settings popup, change the settings to the following:

MA crossover alert settings

If you want email or SMS alerts, you can select them under Alert actions.

Click the Create button to set the alert.

Final Thoughts

The best part about these setups is that they are simple and can be added to any chart, on any platform.

But just knowing about these entries is not enough.

You have to backtest the strategies to see if they have an edge in the market(s) you trade.

Then keep a good trading journal to be sure that you're executing your trades correctly.

The post Golden Cross vs Death Cross Differences Explained appeared first on Trading Heroes.

]]>