Trading – Earlybirds Invest https://earlybirdsinvest.com Latest Crypto News Thu, 28 Aug 2025 08:12:37 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.9 https://i0.wp.com/earlybirdsinvest.com/wp-content/uploads/2024/12/cropped-New-Project-2024-12-17T235703.455.png?fit=32%2C32&ssl=1 Trading – Earlybirds Invest https://earlybirdsinvest.com 32 32 240146708 This Bollinger Band Trading System Has Generated 7577% Over The Last 30 Years https://earlybirdsinvest.com/this-bollinger-band-trading-system-has-generated-7577-over-the-last-30-years/ https://earlybirdsinvest.com/this-bollinger-band-trading-system-has-generated-7577-over-the-last-30-years/#respond Thu, 28 Aug 2025 08:12:36 +0000 https://earlybirdsinvest.com/this-bollinger-band-trading-system-has-generated-7577-over-the-last-30-years/

Like myself, perhaps the Bollinger Band was one of the first indicators you discovered at the beginning of your trading journey.

After all, it’s supposed to make everything super easy…

…just buy low and sell high, right!?…


bollinger band

Well, sure, there may be some lucky wins at the start.

But as time goes on… you start experiencing losses…


bollinger band

Worse yet, they can come along much more frequently with the Bollinger Band!

So, you stop using the indicator and probably start learning about RSI… moving averages…

…you start system hopping.

I’m guessing it may be a familiar scenario.

It was for me, anyway!

But, what if I told you there’s a provable way the Bollinger Band works consistently in real markets?

Not just in profits, but statistically, too?

Well, that’s what I’m about to show you in this guide.

Specifically, you’ll learn:

  • A quick refresher on how the Bollinger Band works and how a lot of traders use it
  • Timeless trading principles on how to build a working Bollinger Band trading system
  • The rules of the Bollinger Band trading system and why they exist
  • A complete metric of the results of the Bollinger Band trading system

You ready?

Then let’s get started…

How the Bollinger Band works and how to use it

The indicator pretty much consists of three things:

  1. Upper Band
  2. Middle Band
  3. Lower Band

Starting at the heart of this indicator is a 20-period moving average…

 


bollinger band

The indicator works by adding a standard deviation of 2 to the upper band and subtracting a standard deviation of 2 from the lower band…


bollinger band

Basically, it adds “distance” to the moving average at the middle band.

Now, how do traders interpret it?

Well, if the price is at the upper band, it’s considered expensive, and considered cheap when it’s at the lower band…


bollinger band

These examples can then be used to introduce a couple of strategies, such as “buying low and selling high”…

It’s essentially the textbook approach to using this indicator.

But, while it sounds great in theory…

…how does it perform in reality?

Hmm, not always in the way you’d expect!…


bollinger band

As you can see, in down trends, the price keeps getting cheaper and cheaper.

Imagine if you buy at the lower band and you’re still holding your trade, hoping that the price will bounce back higher… not a great time!

Which leaves you wondering again…

“What, if the Bollinger Band doesn’t work on trending markets…”

“What’s the point of this guide?”

“Does the indicator work at all?”

Well, indicators are only ever a small part of a working trading strategy.

If you focus solely on the Bollinger Band, you’ll miss out on how to integrate it into a profitable trading system!

Which is why in the next section…

…I’ll explain the foundation behind how the system I’m going to share with you made +7,605% over the last 30 years.

So, let’s take the first step on learning how this system works.

Basic rules and concepts behind the Bollinger Band trading system

Let’s get straight to the point, shall we?

The Bollinger Band trading system that I will share with you mainly trades stocks.

Why the stock markets?

The main reason is that the stock market can move like a tide.

This means that whenever the markets are in a bull run…


bollinger band

…hundreds of opportunities arise in the stock markets!

And this is what the created system works on: riding and taking advantage of those “tides” in the market.

Now with that said…

What kind of stocks are most suitable?

Most of the textbook examples of the Bollinger Band indicator look something like this…


bollinger band

So they’re implying it’s an indicator best traded in a range.

But what if the Bollinger Band could take advantage of an uptrend?

Well, let’s keep building up to that!

But for now…

Start searching for stocks that trend.

That’s right, not ranging stocks, but trending ones!

Why?

Because stocks that are in an uptrend are already likely to continue higher.

You want to hop in and bet on a leading horse!

And the best part is that whenever you spot a trending stock, it already means that the overall sentiment of the market in that stock is great.

As for how the company has been managed, or how consistent it is in its earnings growth…

…all (probably) priced into the chart already!

So now, with the stock chosen, what’s next?

How do you use the Bollinger Band, and why?

All indicators are tools – they are just one aspect of getting things done.

Don’t you agree?

The first question you must always ask is:

“What kind of setups are you looking to enter trades?”

Which, in this case…

…it’s stocks that are trending:..


bollinger band

Importantly, you also want to look for pullback setups, so that you can “buy low and sell high” in favour of the overall trend…


bollinger band

With that well-defined, the next question you may ask is…

“Which indicator can help me find these setups and entries systematically?”

Now that is a great question.

Luckily, it’s going to be the Bollinger Band!

In what way?

Simply put, by entering pullbacks at the lower band on top of a trending stock…

bollinger band

Now, whether or not you use the Bollinger Band, it’s important to treat all indicators as a tool.

In creating any system, you should always keep your mind as structured as possible.

First, work out what setup you want to trade, then find the appropriate indicator to help you look for and enter those setups.

Make sense?

Good, because now comes the fun part…

The Bollinger Band trading system itself.

In the next sections, explore the complete rules of this system, as well as the results, so you can decide for yourself.

You ready?

Then let’s get on with it!

The complete rules of the Bollinger Band trading system

One thing to note is that the trading system you’re about to learn is based on mean reversion trading.

This means you buy stocks on a pullback and then sell them on the rally.

It looks something like this…


bollinger band

With that in mind, here are the rules of this Bollinger Band trading system…

Markets traded:

Stocks in the Russell 1000 index

Timeframe:

Daily

Risk management:

20% capital for each stock and a maximum of 5 positions

Trading rules:

  1. The stock is above the 200-day moving average
  2. The stock closes below the lower Bollinger Band
  3. Place a 3% buy limit order below the last closing price
  4. If there are too many stocks to choose from, select the ones that have increased the most in price over the last 100 days (criteria to rank stocks from strongest to weakest)
  5. If your order is filled, sell when the 2-day RSI crosses above 50 or after 10 trading days (criteria to define the sell signal)

And just to add, the Bollinger Band settings are: 20-day moving average and 2.5 standard deviation.

I know it’s a lot to take in all of a sudden.

So, let me walk you through each of those rules.

The stock is above the 200-day moving average

Recall that you’re trying to trade pullbacks on stocks that are in an uptrend.

And as you know, there are a hundred ways to define what an “uptrend” is!

So to make this definition systematic, simply use a 200-day moving average…


bollinger band

That means if a stock’s price is above the 200-period moving average, it meets the first criterion!

Add it to the list!

And if it’s below the 200-period MA?

Skip the stock.

But, is there an easy way to filter for these?

Well, you can use TradingView’s free scanning tool!…


bollinger band

First, set your market to the Russell 1000…


bollinger band

And apply the moving average filter…


bollinger band

Set it to 200-period, so it only filters the correct stocks…


bollinger band

And with that, you’ve already got a powerful filter for this system!

Now don’t worry, as I go through the rules, I’ll continue to build upon this screener so you can follow.

With that said, what’s the next thing to look for?

The stock has closed below the lower Bollinger Band

This is where the Bollinger Band indicator comes in.

It’s used to systematically define a pullback – waiting for the price to “close” below the lower band…


bollinger band

In the TradingView screener, go ahead and apply the Bollinger Band indicator filter…


bollinger band


bollinger band

And finally, set it to only look for stocks where the price is below the lower band…


bollinger band

This means that on-top of the 200-period moving average filter, this screener will only look for stocks if the lower band is above the price, rather, if the price is below the lower band.

With that in place, if the stock makes a close below the lower band, what’s next?

If there are too many stocks to choose from, select the ones that have increased the most in price over the last 100 days

One merit of the stock markets is that when things are going great, countless opportunities arise.

This means that in a bull market, stocks are trending most of the time.

However, a trading portfolio can only handle so much.

This leads to the question… which one to buy?

Well, this rule specifically answers that!

Based on the screener results, you can see the following…


bollinger band

So what you have to do now is get each stock’s “rate of change” value.

Specifically, you’d have to pull up the rate of change indicator and set it at a  100-period…


bollinger band

Based on what can be seen in the above example, REGN has a ROC value of -31.73

Now, although you need to obtain the 100-day ROC value for all the stocks listed in your screener results yourself, for the sake of this guide, I have provided some example values for you here!

  • REGN: -31.73
  • STZ: -19.66
  • TPL: -8.01
  • STLD: +8.77
  • A: -8.03
  • COO: -7.54
  • CACI: +1.87
  • S: -22.8

What you need to do next is rank them based on their values:

  1. STLD: +8.77
  2. CACI: +1.87
  3. COO: -7.54
  4. TPL: -8.01
  5. BF.A: -8.03
  6. STZ: -19.66
  7. S: -22.8
  8. REGN: -31.73

Recall, this Bollinger Band trading system has a maximum of 5 trades.

This means you should allocate no more than 20% of your capital to each stock.

So, this is a way of finding out which stocks are most deserving of your money!

And based on the rankings in this example…

You’d have to prioritize entering STLD, CACI, COO, TPL, and BF.A! (and ignore the rest.)

Now, if, for example, you already have 3 open trades, then all you need to do is to only enter the top 2 on the list.

So to reiterate – rank stocks from strongest to weakest based on their 100-day rate of change.

Then, prioritize trading them based on the ranking until you reach 5 total open trades!

With that out of the way, let’s now move on to entries and exits.

The best piece of advice I have is…

Place a 3% buy limit order below the last closing price

Whatever the last closing price is, as the stock closes below the lower band…

Just subtract 3% from the price, and then you get your limit order price!…


bollinger band

The reason you do this is that you want the stock to come to you even further.

There needs to be sellers still seeking the bottom, only for the buyers to swoop the price back in like an extended rubber band…


bollinger band

Essentially, if your limit order did not get triggered…

…take the order out and do your scans again the next day.

Make sure no limit order lasts more than a day!

Got it?

Overall, this rule is a pretty great criterion to identify oversold stocks.

So, now that you’ve entered the trade, how do you manage it?

After all, there’s no point in entering a stock if you don’t know how to exit it, right?

Importantly, no “gut feelings” necessary here, either…

If your order is filled, sell when the 2-day RSI crosses above 50 or after 10 trading days

I know, this article is about the Bollinger Bands.

So, why the heck is the RSI sliding into this article?

Well, the 200-period moving average makes sure the stocks being traded are in an uptrend.

With that in place, the Bollinger Band helps you enter and look for pullback setups.

The RSI indicator helps work out exits.

Recall, the idea of this strategy is to capture pullbacks…


bollinger band

At the same time, you don’t want to overstay into the trade, and at best, only capture the strength of that pullback setup.”…


bollinger band

And this, my friend, is what the RSI indicator is for

Once you’re in the trade, wait for the price to close above RSI 50…


bollinger band

Then, exit the next day at the market’s “opening”…


bollinger band

Oh, and don’t forget plan B.

Just in case the stock doesn’t do anything, there should also be a time-stop.

If the price doesn’t close above the RSI 50 after 10 day?

Exit on the 11th day.

And yes, if your limit order gets triggered, it already counts as the first day!

Make sense?

So now to address the questions lurking at the back of your mind…

Does this strategy work?

If it works, what kind of returns can you expect?

Bollinger Band Trading System Results

Notice how I always say “system” throughout this guide?

It’s intentional, because clearly there’s more than one aspect involved here.

However,  the rules are objective and clearly defined, meaning it can be easily tested.

In this case, let’s backtest it from 1995 to 2024.

This set of data means that the strategy will show its performance, even through multiple financial crises!

And of course, this system operates in the Russell 1000 universe.

P.S. the data also includes stocks that are already delisted as well as stocks that came in and out of the Russell 1000 index.

So, here are the results…

  • Net profit: +7,577.84%
  • Number of trades: 1365
  • Average Annual return: +15.56%
  • Maximum drawdown: -23.20%
  • Winning rate:94%
  • Payoff ratio:74


bollinger band


bollinger band

As you can see, this system only had 2 losing years out of all 30, and if you look at the statistics, this system has a win rate of 66%.

That’s one heck of a system!

I mean, sure, there are some mediocre years…

But overall, it’s clear the system has an edge in the markets.

However, as with all strategies, there are weaknesses.

Any strategies will have their losing streaks.

So, for transparency, here’s an underwater equity curve of this system…


bollinger band

Basically, it shows how often the Bollinger Band trading system goes into a losing streak and for how long it stays there before it breaks even again.

And there you go!

A complete Bollinger Band trading system that works in the markets!

Now at this point, all that’s left is for you to apply the system, which admittedly is the hardest part.

Because as time goes on, you need to develop a full understanding of this strategy.

Which, at this point, you might start wondering…

“Why this indicator?”

“Would the system still work if I modified the settings?”

“How about trading this system in the S&P 500? Will the system still work?”

Rest assured, I have created an FAQ section, which likely contains the answers!…

Frequently Asked Questions

Some commonly asked questions about the Bollinger Bands trading system…

What type of order do I use to enter the trade?

As per the rules of the strategy, always use a limit order.

If your limit order does not get triggered for today’s session, for example, then the limit order must expire.

Basically, no buy limit order lasts more than one day.

Why do you use the Russell 1000 instead of the S&P 500?

There’s no particular reason.

You can use the S&P 500, and the trading system will still work!

When it comes to the 200-period moving average, do I use a simple or exponential moving average?

I use a simple moving average but to be honest, it doesn’t matter.

You can use an exponential or weighted average, and the trading system will still work!

The concept behind it is what matters, not the parameters.

I’d be worried if a trading system broke down simply because of a parameter change!

Does the Bollinger Band trading system work for short selling using an opposite set of trading rules, meaning you short stocks at the upper band?

I’ve backtested this extensively, and unfortunately…

It doesn’t work.

Would this trading system work for Forex markets?

Different markets have different behaviours.

So, if you want to trade this system on other markets, those markets must have a mean-reverting behaviour or it won’t work.

What does position size 20% mean?

It means 20% of your capital will be used to buy a stock.

For example, let’s say you have $100,000 capital and you need to buy stocks A, B, C, ,D and E.

This means you’ll allocate $20,000 to stocks A, B, C, D, and E.

After which, all your trading capital will be used up, and you’ll not take any new positions (even if there’s a valid setup).

Isn’t it dangerous to trade without a stop loss?

Although you’re trading without a stop loss, you have a time stop of 10 trading days.

So, if the exit signal is not met within 10 trading days, you’ll exit the trade on the open of the 11th trading day.

Also, for you to lose all your trading capital, every stock you buy must drop to $0.

It’s possible but unlikely as you’re trading stocks in the Russell 1000 (which are the 1000 largest stocks in the USA).

You rank stocks according to their Rate of Change (ROC). Is there a minimum ROC value you’re looking at?

No, there’s no minimum value for it.

If the screener results show a stock with a negative rate of change, do I still take the trade?

Yes, you still take the trade even though the stock has a negative rate of change

How much starting capital do you need to start trading with this system?

You should have at least $3,000 to trade the Bollinger Band trading system.

But if your broker allows you to trade fractional shares, then you can open an account smaller than $3,000

What if the stock price gap is more than 3% lower? Do I still buy the stock?

Yes, you will still buy the stock, albeit at a lower price (below your limit order).

Also, turn OFF pre-market trading. Most platforms have it turned off by default, but if yours is on, please switch it to OFF. If not, you will end up buying the stock at a higher price.

Now, here’s one secret that I want to tell you:

This is just one of the working systems.

What was discussed here is mean-reversion trading; however, there are also trend-following systems and breakout trading systems.

All with an edge in the markets!

Now, imagine if you could trade multiple (uncorrelated) trading systems that work.

It’s like having multiple streams of long-term income, right?

So, if you want to learn more about it, then there’s a new book being released called Trading Systems That Work.

In this book, you’ll get the full package.

It contains the system I shared with you today but much improved, and also three other systems.

If you’re interested, then you can check it out here.

With that said…

I want to know what you think.

Do you think that systems trading is the “easiest” way to find an edge in the market?

If so, do you plan to develop your system someday?

Or try to trade one that already works and then work from there?

Let me know your thoughts in the comments below!

]]>
https://earlybirdsinvest.com/this-bollinger-band-trading-system-has-generated-7577-over-the-last-30-years/feed/ 0 55513
50-200 Moving Average Crossover Strategy v1 Backtesting Results https://earlybirdsinvest.com/50-200-moving-average-crossover-strategy-v1-backtesting-results/ https://earlybirdsinvest.com/50-200-moving-average-crossover-strategy-v1-backtesting-results/#respond Wed, 20 Aug 2025 21:03:37 +0000 https://earlybirdsinvest.com/50-200-moving-average-crossover-strategy-v1-backtesting-results/

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.

 

]]>
https://earlybirdsinvest.com/50-200-moving-average-crossover-strategy-v1-backtesting-results/feed/ 0 54257
How to Create a No-Code, Automated 50-200 MA Crossover Strategy https://earlybirdsinvest.com/how-to-create-a-no-code-automated-50-200-ma-crossover-strategy/ https://earlybirdsinvest.com/how-to-create-a-no-code-automated-50-200-ma-crossover-strategy/#respond Wed, 20 Aug 2025 16:42:26 +0000 https://earlybirdsinvest.com/how-to-create-a-no-code-automated-50-200-ma-crossover-strategy/

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.

 

]]>
https://earlybirdsinvest.com/how-to-create-a-no-code-automated-50-200-ma-crossover-strategy/feed/ 0 54224
How to Manually Backtest Multiple Markets at the Same Time https://earlybirdsinvest.com/how-to-manually-backtest-multiple-markets-at-the-same-time/ https://earlybirdsinvest.com/how-to-manually-backtest-multiple-markets-at-the-same-time/#respond Wed, 20 Aug 2025 12:21:38 +0000 https://earlybirdsinvest.com/how-to-manually-backtest-multiple-markets-at-the-same-time/

Backtesting multiple markets at the same time has several benefits.

The short version is that you’ll save time and you can test based on market correlations.

This process will be similar to backtesting multiple timeframes at the same time, but will require a couple of additional setups.

Backtesting multiple markets is easy with an automated strategy.

Just run the trading program against data from different markets.

But viewing multiple markets at the same time is not as easy with manual testing.

In this quick tutorial I’ll give you the benefits and downsides of manual multiple market backtesting and exactly how to do it.

?

Benefits of Backtesting Multiple Markets Simultaneously

If you already know about the benefits of backtesting multiple markets, skip down to the section on setups.

But if you aren’t sure why you should do it, here are the top 2 reasons.

Save Time

Trader at yacht harbor

First, testing multiple markets can save you a ton of time.

Let’s say that you want to manually backtest a trading strategy on the EURUSD and the S&P500 at the same time.

Furthermore, let’s say that testing each market individually will take you 2 days.

If you run both charts at the same time and take trades on both charts, it might only take 2.5 days to do your test instead of 4 days.

This is a huge benefit.

See Market Correlations

The other reason to backtest multiple markets at the same time is to see market correlations.

For example, a frequently talked about correlation is between the CADJPY and Oil.

Since Canada is a major oil exporter and Japan imports all of its oil, the price of oil can effect each economy accordingly.

As always, don’t take my word for it, backtest it yourself.

There are many other market dynamics at play with regard to currency prices, so the price of oil isn’t always going to be the biggest influence.

But if you want to test this, it can be tough to see the correlation (or lack thereof) if you are only backtesting one market at a time.

Having both charts side by side makes this easy.

Downsides of Backtesting Multiple Markets Simultaneously

Multiple market backtesting is not all sunshine and unicorns though.

Here’s what you should be aware of if you’re going to do this.

Loss of Focus

One potential downside is that you could miss some signals, if you have too many markets open at the same time.

So if you want to test on multiple markets, you have to be super focused.

It’s really easy to miss trades when you have several charts going at the same time.

I would suggest not testing more than 3 markets at the same time…max.

Two markets is ideal.

Computer Slow Down

If you have too many markets open at the same time, this can also slow down your computer.

Your trading program will have to update the data for each chart and also calculate your indicators (if you’re using any).

Depending on how powerful your computer is, and which backtesting software you’re using, this might slow things down.

So be sure that you have a decent computer and software that can handle this.

The most important spec on a computer is going to be the amount of RAM you have.

Processor speed does contribute to the overall speed, but as long as you have a processor made in the last 5 years, you’ll see way more gains from RAM.

At least 16GB is recommended, but 32 GB or more is ideal.

How to Setup a Backtest in Multiple Markets

Alright, now that you have some background on multi-market manual backtesting let’s get into actually how to do this.

I’ve personally done this with NakedMarkets and Forex Tester, but this will work in a similar way in other programs.

It’s not possible to do this in something like MetaTrader.

If your software cannot do this, I would highly suggest switching to NakedMarkets.

This software is much more optimized for multiple market backtesting than Forex Tester.

I’ll use NakedMarkets for the rest of this tutorial because that’s what I use.

Step 1: Download Historical Data

You’re going to need some data to test with, so the first step is to go to: Tools > Data Center and download historical data for the markets you want to test.

NakedMarkets provides updated historical data for free, no subscription needed.

NakedMarkets Data Center

Step 3: Setup the Backtest

Once the data is loaded, it’s time to add your charts and set them up.

Go to: File > New Backtest

New backtest

Name your backtest and the starting balance for the account.

Then click Next.

Create new backtest

The choose the markets you want to backtest. Be sure to select more than one market on this screen.

Click on Next.

markets to backtest list

Use the default settings on the last screen and click on Finish.

Last screen

Now a window for each market will open.

Charts open

Resize the windows to your liking.

Resize charts

If you need to add more windows, click on: File > Add New Chart and select the chart you want to add.

You’ll only be able to add markets that you selected when you created the backtest.

Keep in mind that you can also have multiple timeframes for each market.

Simply add another chart for each market, then change the timeframe of the second chart.

You can also change the timeframe of each chart by clicking on the chart you want to change, then clicking on the timeframe buttons in the upper left corner of the screen.

Once all of your charts are setup, it’s time to start backtesting!

Step 4: Press Play and Start Taking Trades

The hard part is done, now it’s time to start testing.

Press the play button in your software and it will advance all of your charts at the same speed.

Play button in NakedMarkets

Take trades according to your trading plan.

Step 5: Review Your Results

Once you’ve completed a full round of backtesting, it’s time to see how well you did.

A common mistake is to judge a trading strategy purely on its total return.

Professionals examine at all aspects of a strategy to identify its potential because most strategies won’t have good results on the first try. 

There are 3 main questions that you should ask yourself when reviewing your backtesting results:

  • Can I possibly improve this strategy? This is usually possible when a strategy is near breakeven. Consider experimenting with your risk management or exits.
  • Can I potentially trade this on different timeframes or in multiple markets at the same time? This can give you more trades, if lack of trades is your problem.
  • Is the overall trend of account balance good? If your strategy wins consistently, but has a low overall return, then you might simply need to increase your risk.

Read more about how to optimize your strategies in this article.

Be willing to experiment with your strategy until you find something that works.

That’s the beauty of backtesting.

You’ll get a good idea of what works BEFORE you actually risk real money.

There is also a creative element, which makes it fun to try out new ideas that you come up with.

Conclusion

So that’s why and how to manually backtest your trading strategies in multiple markets at the same time.

If you’ve been testing one market at a time, this can be a game changer.

It will allow you to find profitable trading strategies and eliminate losers faster.

Happy testing!

 

]]>
https://earlybirdsinvest.com/how-to-manually-backtest-multiple-markets-at-the-same-time/feed/ 0 54192
What is a Good Backtesting Result? https://earlybirdsinvest.com/what-is-a-good-backtesting-result/ https://earlybirdsinvest.com/what-is-a-good-backtesting-result/#respond Wed, 20 Aug 2025 07:58:43 +0000 https://earlybirdsinvest.com/what-is-a-good-backtesting-result/

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

“Well duh, a good backtesting results is when you make 1,000,000% return.”

That’s what many new traders think and that’s why over 90% of traders fail.

If you want to become a successful trader, you’re going to have to learn how properly evaluate a trading strategy and adjust your perception of what is a good backtesting result. 

Spoiler alert: Most successful trading strategies start off as mediocre or even poor. 

But through continual testing and iteration, they are made into profitable strategies.

Just like successful traders are made, not born…successful strategies require an investment of time and effort.

Where to Start

The first thing to understand about backtesting is that almost all successful trading strategies didn’t start out that way. 

A great trading strategy is just like any great invention.

It starts with an idea and the inventor wants to solve a problem.

Traders want to solve the problem of making money consistently in the markets.

You will probably have to refine your trading strategy idea to make it profitable.

Once you understand that trading strategies rarely start off as profitable, it then makes sense that breakeven backtesting or slightly profitable results can actually be a good thing. 

If a strategy is breakeven (or close to it), then you just might have to do a few tweaks to get it to profitable.

Many times, experimenting with money management or exits can make a strategy profitable.

With that in mind, here are more details on what to look for in your testing results.

Historical Data Used in Backtests

Before I get into analyzing your actual backtesting results, one important thing to consider is how much historical data was used in your backtests.

Many backtesting platforms only give you 1 or 2 years of backtesting data.

This is not nearly enough to figure out how a strategy will perform over different market conditions and cycles.

So when you’re backtesting, get as much historical data as possible.

Define a Review Period

Once you have a lot of historical data to test with, be sure to define your review period for your strategies.

If you are creating a strategy on the daily chart, you might want to review the returns on a yearly basis.

Now if you’re testing on the 1 hour chart, you should probably review your monthly results.

Then figure out your average return per your review time period.

You probably won’t be profitable in every review period, but you want to see what type of drawdowns you’ll have to endure and what to expect from the trading strategy.

This analysis will allow you to compare trading strategies in an objective manner and judge which strategies you may want to pursue and which ones to drop.

Set a Goal

Now it’s time to figure out what matters to you.

A “good” trading strategy has to be good for you and nobody else.

It won’t necessarily be the most profitable or the most consistent.

But if it meets your income needs, then that’s all that matters.

A word of caution here…

Many traders (myself included) start out with unrealistic goals for their strategies.

So set a goal, but you might find yourself having to adjust what you expect out of one trading strategy.

You might have to trade several trading strategies or markets to get the results you’re looking for.

Don’t get discouraged however, if you keep working the results will come.

How to Identify Trading Strategies with Potential

There are 3 basic types of backtesting results:

  1. Terrible
  2. Breakeven
  3. Profitable

Now I’ll define each and show you what to look for in each.

A Terrible Backtesting Result

audusd m5 results

This one is obvious.

If the strategy loses 80% of the account or more, then you probably shouldn’t spend any more time with it.

The strategy above lost 99.82% from 2009 to 2024.

That’s as bad as it gets.

Trying to optimize a strategy with a terrible result is like polishing the brass on the Titanic.

It’s best to move on and use your time and brain power to create a new strategy.

A Breakeven Backtesting Result

EURUSD 4-hour results

Here’s where things get exciting. 

Most new traders will throw away a breakeven strategy, but not you because you’re reading this article.

A breakeven strategy can potentially be optimized and made much more profitable.

It might just need a tweak or two to work well.

Here are some questions to ask when trying to improve a strategy:

  • Can you eliminate the biggest losers easily?
  • Do losing trades have a common characteristic? Maybe they go longer than 2 days or they are taken during a certain time of day.
  • What happens if you set a bigger profit target?
  • Can you increase your stop loss, while risking the same percentage of your account, so you don’t get stopped out so often?
  • Will using a trailing stop loss improve your results?
  • How do your results change of you increase or decrease your risk per trade? It may be counterintuitive, but lowering your risk per trade can sometimes increase your total return.

Those are the major things to consider when trying to improve the performance of a strategy.

But don’t stop there, what else can you think of?

A Profitable Backtesting Result

Backtesting results graph

Now we get to the result that everyone is looking for, a profitable result on the first try.

It doesn’t happen often, but it is possible.

I’ve only had a hugely profitable result on the first try…twice.

But even if your results were profitable, you can’t stop there. 

You need to double check your results.

Real world trading could vary dramatically from backtesting results if you don’t account for everything.

Consider the following:

  • Did you properly account for commissions, spread, slippage and fees?
  • Will you be awake to take trades when they setup?
  • Did you follow the trading plan?
  • Did you run a Monte Carlo simulation to see your maximum potential drawdown?

Once you’ve verified that your results are good in a program like NakedMarkets, Forex Tester or FX Replay, congratulations, you now have a profitable trading strategy.

Now it’s time to move on to Forward Testing to be sure it works.

This is a key step to making absolutely sure that your strategy works before risking your full trading capital.

But don’t stop there.

Continue to test ways to potentially make your strategy better.

See if you can increase the return or decrease the drawdowns.

Pick the one that’s more important to you.

Consider trading 2 or 3 versions of your strategy at the same time to diversify your risk.

Once you’re trading your strategy with your full-sized account, then you can repeat the process to find another profitable strategy.

Final Thoughts

Again, you probably won’t get a super profitable backtesting result on your first try.

The key is to be able to spot the diamonds in the rough.

From there, you can work on developing each strategy to its maximum potential.

It’s also important to be able to figure out which strategies will never work and stop trying to improve them right away.

Remember that trading strategies usually tend to perform a little worse in real life.

So account for that and don’t get too excited about a huge return.

Before I go, I’ll leave you with a conversation that we had about this topic on the Think Profit Podcast.

It will give you more ideas on what to look for when you’re backtesting.

?

]]>
https://earlybirdsinvest.com/what-is-a-good-backtesting-result/feed/ 0 54159
How to Partially Close a Trade in MetaTrader 4 https://earlybirdsinvest.com/how-to-partially-close-a-trade-in-metatrader-4/ https://earlybirdsinvest.com/how-to-partially-close-a-trade-in-metatrader-4/#respond Wed, 20 Aug 2025 03:37:58 +0000 https://earlybirdsinvest.com/how-to-partially-close-a-trade-in-metatrader-4/

Closing part of a trade in MT4 isn’t as obvious as it should be.

So in this tutorial, I’ll show you exactly how to do it.

The process is not hard and once you know how it works, you can take partial profits on your trades at any time.

First, let’s take a look at why you might want to do this.

Why Traders Take Partial Profits

The biggest reason traders close part of their trades early is to take some of their profits off the table, while still allowing themselves up to potentially capture bigger profits later.

This can give you a huge psychological boost and allow you to stick with the rest of your trade longer.

When a trade is in profit, then comes back and ends up in a loss, that can give you a huge case of Fear of Missing Out (FOMO).

Many traders will then try to make it back on the next trades, leading to overtrading, revenge trading, or taking profits too early.

So taking partial profits can help you achieve a balance of taking profits while you have them and letting your profits run.

But it’s not a magic bullet.

Be sure to backtest your profit taking method before implementing it.

Now let’s get into how to actually do it.

How to Take Partial Profits on a Trade in MT4

There are 2 ways to take profits in MT4.

I highly recommend doing this in a demo account if you’ve never done it before because if you don’t know what you’re doing, you could mess up a good trade and lose money unnecessarily.

Obviously, you should have a trade open that’s bigger than the 0.01 minimum lot size in MetaTrader, for this to work.

There are 2 ways to close part of a trade:

  • Double-click the trade entry line on the chart
  • Double-click the open trade in the Order window on the bottom of the screen

MT4 chart with open trade

When you do either of these things, you’ll see the Modify Order window.

Order modification window in MT4

Change the following:

  • Type: Change to Market Execution
  • Volume: Enter the number of lots you want to close
  • Close Button: Once all of the settings are correct, click the yellow Close button

That’s it!

Now you’ll see that the Size of your trade will be reduced in the Order window at the bottom of your screen.

Demonstration Video

If you want to see this in action, this video will show you exactly how to do this in MT4.

Final Thoughts

So that’s how to close part of your position in MetaTrader 4.

It’s very useful for taking some profits off the table, while still giving yourself the ability to still capture big moves.

Again, be sure that you practice doing this in a demo account first.

Also backtest your method of taking partial profits to be sure that it actually gives you an edge.

To learn how to backtest, read this tutorial.

 

]]>
https://earlybirdsinvest.com/how-to-partially-close-a-trade-in-metatrader-4/feed/ 0 54123
The Ultimate Guide to TradingView Backtesting https://earlybirdsinvest.com/the-ultimate-guide-to-tradingview-backtesting/ https://earlybirdsinvest.com/the-ultimate-guide-to-tradingview-backtesting/#respond Tue, 19 Aug 2025 23:16:16 +0000 https://earlybirdsinvest.com/the-ultimate-guide-to-tradingview-backtesting/

?

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

In this tutorial, I’ll show you how to use the backtesting function in TradingView and give you the benefits and downsides of this platform, based on my personal experience.

This powerful tool allows traders to test the effectiveness of any trading strategy, whether it’s one they have developed themselves, or one created by a member of the TradingView Community.

Key Takeaways

  • TradingView’s backtesting function allows traders to quickly test a wide selection of trading strategies across a huge collection of worldwide trading markets.
  • The platform offers a variety of strategies created by Community members, as well as the ability to create your own.
  • While there can be limitations to TradingView’s backtesting platform, there are also solutions.

Benefits of TradingView Backtesting

Trading at beach

Here are some of the benefits of using TradingView’s backtesting platform:

  • Fast results: The backtesting system is fast, and you can see the results right away. This allows you to iterate quickly and adjust your strategy accordingly.
  • Community scripts: You can use other traders’ strategies that are available in the Community. This saves you time and effort in developing your own strategy.
  • Historical Data: TradingView has a Deep Backtesting feature that provides all the historical data you need to conduct a thorough backtest.
  • Easy to use: The backtesting function is simple, no complex setups required.
  • Access tons of worldwide markets: TradingView gives traders access to a wide range of markets from around the world. It could be the largest collection of publicly available data feeds in the world.
  • Browser based: Available on almost any operating system.
  • Create your own strategies: Make and test your own strategies quickly with Pine Script.

Now that you know a little about the platform, here’s how to start using it.

How to Access Strategy Tester on TradingView

First make sure that you’re logged into a paid account.

To access the backtesting function, first click the Strategy Tester tab at the bottom of the screen.

Strategy Tester in TradingView

From there, click on the Load Your Strategy button.

This can either be a strategy that you’ve created or one that’s been developed by a Community member within TradingView.

To find a strategy, search by name or browse through the available community scripts.

Be sure to use the menu on the left of the window to see other types of strategies.

Select Personal to see the strategies you’ve created.

TradingView Strategies

Yeah, there are a TON of strategies available and it can be a little overwhelming.

So start with something that you understand and test all the related strategies.

For example, when I search for a Bollinger Bands trading strategy, here’s what comes up.

The number on the right of each strategy indicates the number of people currently using it.

Strategies list in TradingView

Usually, the most popular ones are at the top.

But not always.

So scroll through the strategies to see them all.

Once I click on a strategy, TradingView will add it to my chart, run the backtest on the current market/timeframe and give me the results.

Strategy result

You can see the trades it took and get a performance summary report below the chart.

Pretty slick!

How to Run the Backtest on Other Markets and Timeframes

Once you’ve selected a strategy to backtest, it’s super easy to run the test on any market and timeframe available on TradingView.

To run the test on another timeframe, simply click one of the available timeframes on the top of the current chart.

You can even set your own custom timeframe by clicking on the down arrow and selecting “Add custom interval”.

Timeframes in TradingView

The results of the backtest on that timeframe will appear on the bottom of your screen, just like with the first backtest.

You’ll see the results almost instantly, making this a very efficient way to backtest.

To test the strategy on other markets, click on the watchlist icon in the upper right corner, then click on the market you want to backtest.

TradingView backtest on new market

You can also click on the current market ticker in the upper left corner of the screen and search for a new market to test.

Search for market in TradingView

Again, as soon as you select the market, you’ll see the backtesting results in the bottom panel.

Remove a Trading Strategy

To remove a strategy from your chart, click on the Object Tree icon on right side of the screen, then click the Delete icon next to the trading strategy.

Remove TradingView strategy

Once you’ve deleted a strategy, you can a new one, or go back to using TradingView as just a charting platform.

Evaluating Backtesting Results

Now it’s important to talk about what a “good” backtesting result is.

Many new traders think that they need to have a fantastic result on the first try, or the backtest is a failure.

That’s not how it works.

In reality, it’s best to look for strategies that have potential.

So here are some things to look for:

  • The strategy is near breakeven: The strategy could be optimized
  • There are huge winners, which get slowly get taken out by small losers: The number of losers could possibly be reduced
  • Conversely, there are consistent small winners, but a few big losers: The size of the losing trades could be reduced
  • Strategies that perform well in some markets but not others: Only trade it in markets where it performs well

But that’s just the tip of the iceberg.

To get a complete guide on how to judge and potentially improve backtesting results, read my article on good backtesting results.

Selecting a Trading Strategy the Smart Way

When it comes to selecting strategies to test, there are a couple of ways to approach it.

First, you can browse the available strategies that you can use for free, as I mentioned above.

Sort the strategies by popularity and backtest each one.

This is a decent method if you don’t know where to start.

But you’ll quickly learn that most of the free strategies don’t work.

Yeah, you generally get what you pay for.

And there are so many strategies out there that it would take forever to test them all.

So once you get tired of looking for random ass strategies, it’s time to get smarter.

A better way to approach this proess is to start by asking yourself what type of strategy you’re looking for:

  • Do you prefer trend strategies?
  • Do you want to trade a RSI strategy?
  • Do you want to day trade?

Then take a look at all of the strategies that fall into your chosen category.

Search keywords related to the type of strategy you want to find. 

Backtest them and see how they perform.

Again, chances are very good that they won’t work.

But they might.

Worst case scenario, they will give you a good starting point and ideas for your own strategy.

This is a huge benefit of the TradingView Community.

How to Create Your Own Strategy

Since many of the trading strategies on TradingView are free and open source, you can use them to help build your own strategy quickly.

First find a free strategy that you want to build on.

Then create your own Pine Script project by clicking on the Pine Editor tab at the bottom of the screen.

TradingView Pine Editor

Copy and paste an existing strategy into the Pine Script tab and start making adjustments.

Save the strategy, then run a backtest.

Yes, you need to learn Pine Script.

But most programming tutorials can be very boring.

When you know what you want and you have a starting template to get there, learning becomes much more fun and you’ll usually see results faster.

Focus on the parts of the current script that you want to change and go from there.

To sign up for TradingView, go here.

Considerations of Historical Data Availability

When using the backtesting function in TradingView, it is important to understand how much historical data is being tested in each test.

Data availability will vary by market and timeframe.

Higher timeframe charts like the daily, weekly and monthly charts will usually have enough data to do valid tests.

But on lower timeframes, such as the 4-hour chart and below, the historical data is very limited.

You may only have access to two or three years of data, which is never sufficient to do a thorough backtest.

Be sure to read more about how to how many trades you need to have confidence in a trading strategy.

If you require the entire data set for a particular market, you’ll need to subscribe to the Deep Backtesting feature, which is only available on the higher tier paid plans.

This is a big downside of the platform.

If you don’t want to pay the higher TradingView monthly fee, there are other solutions such as Naked Markets, which usually provides much more historical data than TradingView and free ongoing data updates, for just a one-time investment.

Limitations and Downsides

Here are the limitations of TradingView to be aware of:

  • The backtesting function is only available on TradingView paid plans.
  • TradingView lacks sufficient historical trading data on the lower tier plans. It can be enough data on the higher timeframes, such as the daily chart. As you move down to lower time frames like the 4-hour or 1-hour chart, you may only get two or three years of data, which is not enough. You have to pay more for Deep Backtesting to get more comprehensive data.
  • There’s no way to upload your own historical data.
  • You can only backtest one market, strategy and timeframe at a time. There is currently no way to backtest multiple variables simultaneously.
  • No offline testing.
  • The reporting metrics are decent, but still limited. I would like to see more detailed backtesting statistics.
  • Although TradingView’s backtesting function is useful, it is not a substitute for live trading. You should still exercise caution and not rely solely on backtesting results. Be sure to implement Forward Testing before risking real money on a strategy.

While TradingView’s backtesting function has its limitations and costs, it can be a valuable tool for testing trading strategies quickly.

Conclusion

Based on my experience with the backtesting function in TradingView, it’s not for everyone.

It only really makes sense if you can do 2 things:

  1. Code in Pine Script
  2. Subscribe to a paid plan that has Deep Backtesting capability

One big benefit of the backtesting feature is that you can test community-created trading strategies and scripts.

Unfortunately, most of them are useless. That’s no different than any other platform.

But they can be an excellent starting point to give you ideas for your own strategy.

If you want to backtest manually, TradingView also has a Bar Replay function that will eliminate the need to learn Pine Script.

So at the end of the day, backtesting in TradingView can make sense for some traders, but it’s not for everyone.

That said, I strongly feel that TradingView is the best charting platform available and I highly recommend it for that.

 

]]>
https://earlybirdsinvest.com/the-ultimate-guide-to-tradingview-backtesting/feed/ 0 54087
10 Benefits of Forex Hedging Most Traders Don’t Know About https://earlybirdsinvest.com/10-benefits-of-forex-hedging-most-traders-dont-know-about/ https://earlybirdsinvest.com/10-benefits-of-forex-hedging-most-traders-dont-know-about/#respond Tue, 19 Aug 2025 18:54:21 +0000 https://earlybirdsinvest.com/10-benefits-of-forex-hedging-most-traders-dont-know-about/

10 Hedging Benefits

Hedging is possibly the most misunderstood trading method in the world.

It’s also technically not allowed in U.S.-based accounts, so many traders think that there’s something wrong with this trading method.

But if you take a closer look, there are many benefits to Forex hedging that I’ll go over in this article. 

You might just change your mind. 

Even though there are a lot of benefits to hedging, remember that there are no magic trading strategies that are guaranteed to make money.

The trading strategy you use must match your trading personality and be practiced extensively to achieve mastery.

With that said, let’s get into it.

1. Less or No Margin Required

Depending on the broker you use, a fully hedged position can require half the amount of margin, or even no margin at all.

For example, let’s say that you’re long 1 standard lot of EURUSD, and short 1 standard lot, at the same time.

If the margin for 1 standard lot is $250, you might only have to put up $250 for BOTH positions, which would ordinarily cost you $500.

At some brokers, you don’t need any margin at all if you have a fully hedged (1:1) position.

This is a big advantage because you can basically have double the opportunities to profit, at half the cost.

Of course, there is also twice the opportunity to have a loss.

But if you know what you’re doing and have practiced your hedging strategy, using less margin is generally a very good thing.

It gives you more opportunity to get out of losing trades.

Unfortunately, this does not apply if you hedge in a U.S.-based account. But it’s still possible to hedge in an account based in the U.S.

More on that in a bit.

2. Potential to Make Money in Both Directions

Almost all trading strategies require that you to pick the direction that you think the market will go.

It’s either up or down.

But with hedging, I can potentially make money in both directions.

I’ve even done demonstrations where I have opened a long and a short trade at the same time and made a net profit on both trades.

In this way, it’s unlike any other trading method out there.

Now in all fairness, this can lead to overtrading, so it’s important to learn hedging in a demo or simulation account before ever risking real money.

However, hedging gives me more opportunities, and that makes my job easier.

If you want to learn more about hedging, be sure to read my Hedging Guide for Beginners.

3. The Ability to Wait for More Information

This is a big one.

Have you ever thought that price would move in one direction, but as you saw more candles, it was pretty obvious that you were wrong about your initial prediction?

Of course, that happens all the time in trading.

The beauty of hedging is that I can take positions in both directions and wait until the market gives me solid clues that it will go in one direction or the other.

This can be a huge advantage because many times the markets will throw a “fake out” before making a big move in the opposite direction.

Even though I might be very sure about the initial position, that picture can change quickly and hedging gives me the ability to adjust.

4. Lower Stress

Trader at beach

Sometimes I don’t feel like trading.

When that happens, I can simply hedge my positions and get back to them when I feel like it.

Sure, I’ll lose a bit of money on the swap.

But the ability to take a break is priceless.

Try doing that with any other trading method out there.

On top of that, I never have the stress of worrying if I’ll get stopped out of a trade…even during rollover. 

If you’ve been trading for any length of time, you know that sinking feeling when you go to check your charts and you’ve just been stopped out…again.

Not the best way to start the day.

Get stopped out multiple times in a row and that can start to mess with your confidence.

With hedging, there are no stop losses, so I never have to worry about getting stopped out.

I simply hedge the losing position and move on.

A hedge still limits my risk, while giving me the opportunity to profit in either direction.

5. Potential to Make Passive Income

There was a period of time when the Japanese Yen was a popular currency to trade because the interest rate differential between the Yen and the US dollar was so high that traders could simply profit from the interest.

Traders were making big money by just holding their positions.

It was rumored that even Japanese housewives were trading this method because it was so easy and reliable.

I know a trader who did this full time as her only strategy.

But all good things come to an end and the trade eventually stopped working.

Some traders lost their entire accounts.

However, if you use hedging to target high interest rate differential trades, it’s possible to still take advantage of this method on a shorter term basis, while limiting your risk.

6. Massive Liquidity and Lower Fees

One of the reasons why I prefer Forex hedging is because the market is massive.

Forex is the largest trading market in the world.

Since there are more traders to take the other side of your trade, you are more likely to get the price on your screen and suffer less slippage.

Other markets like futures, options and crypto have much less liquidity, which means that you might not get the price you want or you may not even be able to enter a trade at all.

On top of that, Forex generally has lower transaction costs than other markets, especially at smaller trade sizes.

So it’s perfect for a wide range of traders, from beginner to professional.

7. Maximum Flexibility

Hedging chart

Pairing hedging with scaling is powerful.

Scaling is opening and closing trades in parts instead of taking the whole trade in one big chunk.

For example let’s say that I want to take a full-sized trade of 3 standard lots.

Instead of opening the trade with all 3 lots at once, I might take 1 lot to start, then see what the market does.

If price doesn’t do what I expected, I can just hedge the 1 lot, instead of having to hedge 3 lots.

Scaling into a trade can also help me get a better average price than entering all at once.

I can enter 1 lot to start, then see what price does. If price action is still favorable, but moves slightly against me, I can enter trades 2 and 3, but at a lower cost than the first trade.

The same thing goes for my exits.

I can set 3 profit targets to capture a small, medium and large profit.

If my last profit target doesn’t get hit and it looks like price will return to my entry, I can simply close out the trade at a smaller than expected profit.

Now double this potential on both the long and short sides.

As you can see, when I use hedging and scaling together, it gives me maximum flexibility to go with the flow of the markets.

8. Can be Added to Other Trading Strategies

Hedging can be a trading strategy in itself.

However, if you couple it with other trading strategies, it can be a powerful way to get out of trades that don’t work out.

This is especially useful if you have a trading strategy that has a high win rate, but you want to boost the overall return of the method.

If a trade doesn’t work out according to the rules of your strategy, you can work your way out of it with a hedge.

Again, you have to master your hedging “escape” method before you ever take a trade.

But it can be a nice addition to an already profitable strategy.

9. More Consistent Returns

I have personally found that hedging creates more consistent returns than most other trading strategies.

Individual results will obviously vary, depending on skill level. 

I’m not saying that you are guaranteed have more consistent returns, but in my experience, it’s certainly possible.

Couple this with lower stress and more flexibility, and that’s why I enjoy hedging.

10. Can be Done in a U.S.-Based Forex Account

?

Contrary to popular belief, you CAN legally hedge in a U.S. Forex account. 

It’s not hedging in a traditional sense, but it’s effectively the same thing.

Hedging in the U.S. is not as easy and it does take more patience, but it can be done.

I DO NOT recommended it, but if you insist on using a broker in the United States, then just know that it is possible.

Final Thoughts

Just like with any other trading method, there are benefits and downsides to Forex Hedging.

It’s not for everyone.

But if this list of benefits appeals to you, then read my free Forex Hedging Guide to get started with this underrated trading method further.

As always, remember to start in a demo account and use play money to perfect your skills before ever risking real money.

]]>
https://earlybirdsinvest.com/10-benefits-of-forex-hedging-most-traders-dont-know-about/feed/ 0 54053
How to Build No-Code MT4 Expert Advisors with ChatGPT https://earlybirdsinvest.com/how-to-build-no-code-mt4-expert-advisors-with-chatgpt/ https://earlybirdsinvest.com/how-to-build-no-code-mt4-expert-advisors-with-chatgpt/#respond Tue, 19 Aug 2025 14:33:44 +0000 https://earlybirdsinvest.com/how-to-build-no-code-mt4-expert-advisors-with-chatgpt/

Artificial Intelligence is still in its early days and there are a lot of bugs to be worked out.

However, one area that I have found it tremendously useful is in the area of creating automated trading robots for trading platforms like MetaTrader 4.

So in this tutorial, I’ll show you how I’m using ChatGPT to create custom MT4 EAs. This process can be very fast and for simple EAs, you don’t even know how to code.

If you prefer the text version, it’s provided below the video.

Tutorial Video

How to Create an EA with ChatGPT

All of these steps should be done in a demo account. 

Never use an EA with real money until you’re absolutely sure that it’s working properly. 

Step 1: Have a Trading Strategy

You can get a trading strategy from almost anywhere…books, websites, YouTube or something you just made up.

Ideally, you should have a trading strategy that you’ve already backtested.

But if you just want to go through the process to see how it works, then just use the example code in the section below.

Step 2: Describe it to ChatGPT

Ask it to create an EA for MT4.

Then explain the rules as clearly as you can to ChatGPT. Write as if you were writing to a friend.

It will generate the code that you need for MT4.

Copy this code from ChatGPT

Step 3: Copy and Paste the Code into MT4

Then open the MetaQuotes Language Editor via the tool bar at the top.

Click the New button to create a new EA.

Select Expert Advisor, give it a name, then leave the rest of the settings blank. Keep hitting the Next button until you get to the end of the wizard.

mql4 EA wizard

That will give you a blank EA template.

Click anywhere in the code, then use Control + A to select all of the text. Then hit Backspace to delete all of the default code, then Control + V on your keyboard to paste in the ChatGPT code.

Click on the Compile button to generate the EA.

Step 4: Check for Errors

If there are any errors or warnings in the code, go back and ask ChatGPT to fix them.

It will generate new code.

Repeat step 3 above to start using the new code.

Step 5: Add the EA to a Chart and Start Testing

Once all the errors and warnings are gone, then you’re ready to start using the EA.

Go to the main MT4 screen and look for the EA in the Navigator window.

MT4 Navigator window

Click and drag your new EA onto the chart.

There should be the name of your EA in the upper right corner of the chart you added it to, next to a happy face.

If the face is sad, click on the AutoTrading button at the top to activate the EA. The happy face shows that the EA is activated.

Now test the EA to see if it’s working properly.

Test all of the regular features AND try to “break” the EA by doing things that it might not expect. This will show you how robust it is and will give you confidence in it.

If you have any issues, go back to ChatGPT and work on fixing them.

This may take several tries, but keep at it.

Example Code

If you want to give this a try, here’s the example code. Simply copy and paste this prompt into ChatGPT and it will generate the code for this EA.

Important: This is for educational purposes only and should NOT be used in live trading. It’s only provided to help you understand how to EA creation process works. There’s a very high probability that this strategy will lose money.

“Please create an Expert Advisor for MetaTrader 4 that executes these rules:

  1. Indicators

  2. Long Entry

    • Condition: Short SMA (2) > Long SMA (36)

    • AND price closes below the Short SMA

    • Action: Open a buy at the close of that bar

  3. Long Exit

  4. Short Entry

    • Condition: Short SMA (2) < Long SMA (36)

    • AND price closes above the Short SMA

    • Action: Open a sell at the close of that bar

  5. Short Exit

  6. Position Sizing & Settings

    • Fixed size: 0.1 lots per trade

    • No stop?loss, no take?profit, no trailing stops”

Words of Warning

Remember that this is just step 1 in the process of creating a fully or partially automated trading strategy.

If you backtested with AI, you really, really have to double check the results.

Even if you didn’t, you still have to check that the code is doing what you expected.

AI can hallucinate, so you have to be extra sure that the EA is doing what you expected before you risk real money.

Never trade the EA live until you’re absolutely sure that it’s working properly. 

Final Tips

I hope that this tutorial will help you create you own tools that improve your trading results.

At the time that this is being written, backtesting with AI is not mature yet.

However, creating EAs for MT4 is very usable, so I would highly recommend learning how to do it.

If you want an awesome example that you can start using right now, check out this EA tutorial.

Even if you never build an EA, you can also build very useful custom indicators that can help you spot trading opportunities and manage parts of your trades.

Have fun!

]]>
https://earlybirdsinvest.com/how-to-build-no-code-mt4-expert-advisors-with-chatgpt/feed/ 0 54021
How to Get MT5 One-Cancels-the-Other (OCO) Orders https://earlybirdsinvest.com/how-to-get-mt5-one-cancels-the-other-oco-orders/ https://earlybirdsinvest.com/how-to-get-mt5-one-cancels-the-other-oco-orders/#respond Tue, 19 Aug 2025 10:12:23 +0000 https://earlybirdsinvest.com/how-to-get-mt5-one-cancels-the-other-oco-orders/

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

I started using MetaTrader back in about 2008.

Unfortunately, it hasn’t changed much, even with the launch of MT5.

That means it still doesn’t have the “One Cancels the Other” order function. Some people, including myself, prefer to call this “Order Cancels Order.”

Whatever you call it, now we can now easily add this order type to MT5 with the help of AI.

You don’t need to know how to code. 

In this tutorial, I’ll show why OCO is so useful and how to use ChatGPT to easily create your own OCO EA for MetaTrader 5.

How OCO Works

“One Cancels the Other” (OCO) trading orders are a type of conditional order where two pending orders are placed simultaneously, but only one can be executed.

When one of the orders is triggered and filled, the other is automatically canceled.

This can be very useful for taking advantage of different trading opportunities.

OCO Example

Here’s an example where you can use an OCO order to take advantage of a potentially profitable situation.

AUDCAD chart

This Pin Bar is also an Engulfing Bar, which could signal a top.

The previous bar had very high volume, showing that this trend could be coming to an end because traders appear to be bailing out.

Now I could enter this trade now, but there is no guarantee that price will drop as expected.

So I can set up 2 pending orders, one sell limit above the current price (higher blue line) and a sell stop below the current price (lower blue line).

The first thing that could happen is price could retrace before moving back down.

If price does retrace, I will enter the trade at a slightly better price and make a little more money. The second trade will be cancelled and I won’t take a duplicate trade.

Even if price retraces and hits a stop loss above the candle, the loss will be smaller than if I entered at the close of the current candle.

Another thing that could happen is price could just head straight down, as expected. In this case, the sell stop (lower blue line) will be hit and the retracement trade will be cancelled.

This pending order will get me into the market if goes in the direction that I expect, but doesn’t retrace. It’s the best of both worlds.

If price doesn’t go as I planned, I’ll lose less money because the sell limit will get hit instead of this sell stop.

As you can see, using a OCO order can be extremely useful.

The amount of money I save by doing this can really add up over time.

MT5 EA Design

Before we talk to ChatGPT, we have to put a little thought into how we will design this MT5 EA.

There are only 2 things that we have to account for.

First, there might be other pending trades in the same market, so we would have to account for that and only cancel orders that we mark for cancellation, and not any others.

Second, we only want to cancel trades in the same market of the chart that the EA is attached to.

This will rule out any trades in other markets that happen to have the same marker.

In MetaTrader 5, we can use the comment field to easily mark trades that we want to apply the OCO logic to.

It takes a little getting used to because in order to use the comment field, the order has to be entered via the right-click menu and not the one-click button.

But it’s not a big deal.

The ChatGPT Prompt to Get OCO in MT5

So for this EA, I’m going to prompt ChatGPT with the following:

Please create an EA for MetaTrader 5 that looks for open orders with a comment in the market of the chart that the EA is attached to. When an open order with a comment is found, cancel all pending orders with a matching comment, in the same market on the next tick. Do not provide any inputs, everything should be done without user input. Automatically match the comment fields.

Feel free to copy and paste that prompt and use it for yourself.

But remember that I’m NOT liable for whatever happens if you choose to use that prompt. 

ChatGPT or another AI might give you a different result than what I got, depending on which model you use, so you always have to test an EA thoroughly before using it in a live account. 

Keep reading to learn how to test it.

Create the Expert Advisor in MT5

Once you get the code from ChatGPT, simply hit the Copy link in the upper right corner of the code window to copy the code.

Copy link in ChatGPT

Then open MT5 and click on the IDE button at the top.

IDE button in MT5

This will open the MQL5 Editor.

Click on the New button in the upper left corner of the screen.

A window will come up with a wizard.

  • On the first screen, select: Expert Advisor (template)
  • Click Next
  • Give the EA a name
  • Keep clicking Next until you get to the end of the wizard

The rest of the settings don’t matter because you’re just going to copy in the code from ChatGPT anyway.

When you see the EA template that MT5 created for you, click anywhere on the screen and it Control+A to select all the text.

Then hit Backspace or Delete on your keyboard to delete everything.

Now hit Control+V to paste the ChatGPT code into the blank area.

Finally, click on the Compile button on the top of the screen to check the code.

If it compiles without errors, congratulations!

Skip down to the installation section below.

Otherwise, use the next section to fix the errors.

Troubleshooting

ChatGPT might not get it right the first time.

When you compile the code, there’s a good chance that you’ll get some errors or warnings like this.

MT5 errors

When that happens, simply highlight all of the error messages in MT5, by using Shift+left mouse click and right-click > copy to copy them.

Then go over to ChatGPT and ask it to fix it.

For example:

Telling ChatGPT to fix compile errors

You might have to do this a few times, but it usually figures it out eventually.

Remember that is only a syntax test.

Now you have to check the logic of the program.

Put it into a demo account and test until you’re confident in the results.

If you’re having problems that you cannot correct, check to see that you’re using MT5.

The code for MT4 and MT5 are different, so you cannot use this EA in MT4.

How to Install the EA

Once the code compiles, go back to the main MT5 window and look in the Navigator window.

If the Navigator section is not available, then go to: View > Navigator to open the window.

Go to the Expert Advisors section and click and drag the EA you created onto the chart.

Add EA to chart

Once it is on the chart, you’ll see the name of the EA in the upper right corner of the chart.

The hat icon should be blue to show that it’s running.

MT5 icon

If it’s not blue, then click the Algo Trading button at the top of the screen to make sure that the EA is activated.

Test the EA

Now it’s time to test your new EA.

Be sure to test this in a DEMO account, just in case something goes wrong. 

To take a trade, right click on the chart you want to trade on.

Go to: Trading > New Order

Comment

In the comment field, enter anything you want to identify the order.

It could be something like “999” or whatever is easy to remember.

Enter the details for the pending order, then open a new pending order and enter the same comment text in the comment field.

To test this quickly, set 2 orders that are very close to the current price, so one of them gets executed right away.

You can also see how the EA treats multiple pending orders with the same comment.

Try every kind of weird situation you can think of to be sure that the EA is working as expected.

Test it until you are 100% confident that it’s working correctly.

More Troubleshooting

If there are issues with the logic of the EA, then go back to ChatGPT to work them out.

At some point, you’ll have to start understanding the code, so now is a good time to start.

You don’t have to know how to code, but you should know how each part of the code works.

Luckily, you can get ChatGPT to explain it to you.

It’s actually quite good at explaining.

Keep asking it questions until you understand how the program works.

Remember that ChatGPT might sound all professional, but it doesn’t know as much as you think.

Tell it exactly what you want and don’t let it insert logic that it thinks is good, but isn’t in line with what you want. 

Like any other skill, building with ChatGPT can be a little frustrating in the beginning.

But once you get the hang of it, it’s extremely powerful and help you build all the trading tools that you’ve always wanted.

Final Thoughts

So that’s how to create an OCO EA for MT5.

But this is just the beginning.

What else can you make?

Use your creativity and let your imagination run wild.

You might just create something amazing…and super profitable.

 

 

]]>
https://earlybirdsinvest.com/how-to-get-mt5-one-cancels-the-other-oco-orders/feed/ 0 53985