how to generate bitcoin trading strategies in EA Studio

How Do I Create Bitcoin Trading Strategies with Software?

Generating 100s of trading strategies for Bitcoin

Hello everyone, in this lecture, I will show you how to generate hundreds of trading strategies for Bitcoin. To achieve this, I will use EA Studio, which is a strategy builder software that we use most in the Academy.

As I’ve said many times in other lectures, EA Studio has a tool called Generator. The Generator can use the historical data that you import from your broker or the Premium historical data that is bundled with EA Studio. In this case, I will use the Premium Data that comes directly from the Forex Historical Data app. And I made it work for the Hot Forex broker which I am using at a moment for Bitcoin trading.

In the Historical data section, I have also the Symbol, which is the currency pair that we’re trading with. Since I want to generate trading strategies for Bitcoin, I will use the BTCUSD symbol. Finally, I have the Period, from where I can select on what timeframe the strategy will trade.

So if I just click on the Start button, you will notice the high speed. This is the fastest Generator for strategies. In just a few seconds, I have over 60 trading strategies. And these strategies all go to the Collection tab automatically.

EA Studio Generator interface
Generating Bitcoin trading strategies in EA Studio

If I click on the Collection, you will see that the Bitcoin trading strategies are listed there. And I have many pages, each containing 10 strategies.

Collection of Bitcoin trading strategies
Collection with trading strategies for BTCUSD

Now, obviously, I don’t want to have some random and simple Bitcoin trading strategies. So I will stop the Generator and I will delete all of these trading strategies. But before actually deleting them, I will click on one of the strategies and I will show you what tools we have in the Strategy section.

How to optimize Bitcoin trading strategies

We have Optimizer and Normalizer. The Optimizer is very similar to the Optimizer that we have in MetaTrader. So if I just click on the Start button in the Optimizer, it will look for better parameters. It didn’t find any in this case, but it will look for better parameters with the trading strategies.

Using EA Studio Optimizer for a Bitcoin trading strategy
Optimizer in EA Studio

Now, optimizing a trading strategy sometimes is very risky because you can over-optimize it. In other words, you will find the best parameters but just for the tested period.

Usually what happens with such strategies is after you start trading, they start losing. Just because you have found the best parameters exactly for the period you are testing. And these are not robust strategies.

Normalize the Bitcoin trading strategies

The next tool we’re going to use when generating our Bitcoin trading strategies is the Normalizer, which is a unique feature of Expert Advisor Studio. It normalizes the strategies, reduces the Stop Loss, the Take Profit if you’re using. In other words, it pushes the parameters to the default parameters.

The Normalizer

Using Walk Forward and Monte Carlo

Then we have the Walk Forward, which is a little bit more advanced tool.

If I click on Start, this tool optimizes the trading strategy for a certain period of time. Then it tests the strategy on the next period, includes that period, and optimizes again, and tests the strategy again.

You can see that it found a much better result, which means that it found a better strategy.

Walk Forward finding a better trading strategy
The Walk Forward

We have the Monte Carlo, which is my favorite instrument among the robust instruments. So, Monte Carlo, Multi Market, and Out of Sample Monitor are robust tools. They don’t change the strategy like the Optimizer, Normalizer, and Walk Forward, but they test the strategy if it is robust or not.

With the Monte Carlo tool, I can test with random historical data, random spread, random slippage, random position entry and exit, and randomly closed position.

We have Strategy variations, which is the option I use the most. This will simply test the strategy with different indicator parameters. And I like to use “Randomize backtest starting bar”, which will backtest the strategy from different bars or from the different starting points. In addition, it is not a bad idea to check “Randomize spread” because as we saw with Hot Forex and with most of the brokers, the spread is floating.

The Monte Carlo

So sometimes your position will open on a $24 spread, sometimes $25. And if there is volatility, it might be even more. So if I click on “Start”, it will perform 20 tests and I see that just 13 out of the 20 were validated. Which is not enough for me. I like to have at least 18 or a minimum of 16 out of the 20, which is 80% of the tests to be validated. That is something I always use.

Testing different markets with Multi Market

Then we have Multi Market where we can add different markets.

The Multi Market

For example, I can add Bitcoin, Ethereum, Ripple, or any other cryptocurrency that I have as historical data and I can check if this trading strategy works well on the other markets.

And as well, I have the Out of Sample, which I will explain just in a minute.

Using the Reactor to generate Bitcoin trading strategies

Now the best thing with EA Studio that was improved during the years is that we don’t have to do all of that manually anymore. I just went over it to demonstrate what we were doing before. We were generating strategies, they were going to the collection after that, if I like any strategy, I was going through Optimizer, Monte Carlo, Multi Market one by one. Understand what I mean?

It was taking time because I had to do it manually for each trading strategy. Now, we don’t need to do this anymore because we have the Reactor. Right under the Generator is the Reactor.

Using the Reactor to generate Bitcoin trading strategies
The Reactor

If I go to Generator, we have historical data, strategy properties, and Generator settings. And if I click on the dropdown arrow after Generator and switch to Reactor, here we have the same things plus optimization and robustness testing.

So what the Reactor does is it passes all the strategies through this testing automatically and I don’t have to do it by myself manually.

So I will remove all the strategies in the Collection. I will switch to the Reactor and I will just set it very quickly so you know how I’m using it.

Now in the Reactor, I will go for Bitcoin on the H1 hourly chart. In the Strategy properties section, I will set Entry lots to 0.01 because this is the minimum quantity I can trade. And I would suggest you always start with 0.01, especially if you are generating Bitcoin trading strategies because this way you will just test the Expert Advisors.

You won’t risk a lot if you try them on your Live Account. And I don’t like to stimulate and motivate my students and traders to use huge volumes or big accounts. That’s a personal choice how much you want to trade. One more time, changing the lot doesn’t change the Bitcoin trading strategy or the Robot. It changes just the result.

Should you use Stop Loss and Take Profit

Then I have the option to select if I want to use Stop Loss or Take Profit. I will not use Stop Loss and Take Profit.

First of all, I have done many tests with EA Studio generating Bitcoin trading strategies with Stop Loss, without Stop Loss, with Take Profit, and without Take Profit. I don’t have 100% proof that one of the two works better.

So if I include Stop Loss, let’s say I will be using a Stop Loss somewhere between 1 000 and 10 000 pips. Now, if your broker has 2 digits (the broker I’m using for this lecture has 3 digits), if I set a Stop Loss, let’s say $100 or $200, then if you are using more or a few digits, the Stop Loss will change. It will become either a $1000 or it will become either a $10.

Setting the Bitcoin trading strategy properties in the Reactor
Setting the Bitcoin trading strategy properties in the Reactor

And that is another thing that I have improved from the previous version of the Bitcoin Algorithmic Trading course where I was including Expert Advisors with Stop Loss and with Take Profit. Some of the students were like, “why don’t the EAs work with my broker” or “why do I see very huge Stop Loss and very huge Take Profit“.

And others were just fine because they were matching the digits with their broker and my broker. That is why when we are talking about Bitcoin, I do not use Stop Loss and Take Profit.

And for the beginner traders, these are automated levels where the position will close on a loss or it will close on a Take Profit.

But if you don’t have a Stop Loss and Take Profit, the strategy will simply exit based on the exit condition. There will be an indicator inside. So no worries if you don’t have Stop Loss. The trade still closes when the exit condition is there. And many traders say that it is better to trade without Stop Loss and Take Profit. One more time for me, I don’t have a 100% statement to say, is it better without or is it better with.

That’s why in the course I include Bitcoin trading strategies that are created without Stop Loss and Take Profit. So we will depend on the entry rules and on the exit rules. But you can test, of course, generating Bitcoin trading strategies with Stop Loss and with Take Profit.

Setting the generation time period in Generator settings

In the Generator settings section, I have the working minutes, so I set it to 1 hour and you will see how many Bitcoin trading strategies it will generate in 60 minutes. Usually, I leave the Reactor working for 10 hours, which is 600 minutes, and this way I leave it overnight and actually right now I’m recording late in the evening, so I will leave it to 600 minutes because I want to get more and more Bitcoin trading strategies.

When we generate for a longer time, it doesn’t mean that we will get better strategies. We will just get a bigger number of strategies. And in the Collection, we will see always the top strategies. The longer you run it, the more chances you have for finding better and better strategies.

Then for Search best, I will leave it the way it is – Net balance – so, at top of the Collection, I will see the Bitcoin trading strategies that have the most profit.

Using Out of Sample (OOS)

I will select 10% Out of Sample and what that means?

If you remember, the Out of Sample Monitor divides the whole backtest period into different zones.

Out of Sample monitor

So if I have 30% Out of Sample, this means that the Generator will use 70% of the historical data to generate Bitcoin trading strategies and it will simulate trading on the last 30% of the data.

Now, if I switch to 10%, this means that the Generator will use 90% of the time. And for the last 10%, it will simulate trading. And in our case, with the historical data that I have, this will be from the 3rd of August until December.

So for a little more than 4 months, it will be just a simulation of how these strategies would perform if I have placed them for trading on the 3rd of August.

The MACD Indicator

But actually, I won’t be testing them on a Demo Account or a Live Account, the strategy builder will do this simulation. And this is one of the methods to avoid over-optimization because I will just choose the strategies that are profiting in these last 4 months.

So going back to the Reactor, I will use Out of Sample 10%. For the Max entry indicators and Max exit indicators. I will leave it as it is.

The Generate strategies with preset indicators setting will be suitable if you have some favorite indicators. For example, let’s say you like the MACD Indicator and you want the MACD in every strategy, you can check that, when you click on it, you will go to Preset Indicators in Tools and then you can add MACD or any other indicator. Then this MACD indicator will be in all of your trading strategies.

Setting preset indicators in EA Studio
Setting preset indicators in EA Studio

But I don’t usually do that. I want the Generator to show me which are the best combinations between different indicators.

How to use the common Acceptance Criteria

Make sure to set a checkmark before the Use the common Acceptance Criteria.

We need to use it. This is where we set some criteria. For example, I will select that I want to have a minimum of 500 counts of trades for every strategy or for every Robot.

Setting a checkmark before the Acceptance Criteria
Generator settings

Now, with time I found out that the more count of trades we use the more robust strategies we have.

Because imagine you have a backtest just with 20-30 trades or you have the Bitcoin trading strategy executing just 20 or 30 trades for the last 3 years. I guess you wouldn’t be happy trading such a strategy.

But having 300, 400, or over 500 trades that happened for the last 3 years, and the strategy is profitable, you will know that this is a robust strategy and you can depend on that strategy for the future. Because if it executed 500 times the same rules and it kept being profitable, then there is a higher chance that the strategy will keep being profitable in the future.

The minimum profit factor of 1.2 is just fine.

The profit factor is the net profit divided by the net losses.

You can add any other criteria, but I will stick to the Minimum count of traders and the Minimum profit factor.

And as well, we have the option to set criteria, for In Sample part which in our case will be the 90% zone. And I will go to the profit factor again, but I will decrease it just to 1.1. I will remove the net profit, no net profit. Obviously, on the top, we will see the strategies that have the most net profit.

So Minimum profit factor is 1.1, and this is the Acceptance Criteria that I will be using while generating the Bitcoin trading strategies.

Setting the The common Acceptance Criteria in EA Studio
The common Acceptance Criteria

So what happens now?

The Generator will produce strategies on Bitcoin, on the hourly chart without Stop Loss and Take Profit. It will generate the strategies over 90% of the historical data. And for the last 10%, it will test them, it will simulate trading and it will pass only the Bitcoin trading strategies that fulfill the Acceptance Criteria. Only the strategies that have more than 500 trades and that have more than 1.2 as a profit factor and that have more than 1.1 in the In Sample and in the Out of Sample.

Avoid optimizing strategies

I’m not going to use Optimize strategies settings because it is risky to over-optimize the strategies.

With my experience, I know that the Generator finds good enough combinations between indicators and parameters, so no need to optimize them and to look for better parameters. That’s personal, in my opinion. So in this lecture, I’m just showing you how I use the Reactor by myself to generate 100s of Bitcoin trading strategies.

And below we have the robustness testing tools. I will leave the Monte Carlo test, meaning that at least 16 out of the 20 tests, or 80%, from the Monte Carlo, should be true.

And if the Bitcoin trading strategies from the Generator pass the Acceptance Criteria, they will go through the Monte Carlo. If they go through the Monte Carlo, we will see them in the Collection.

We will see the number of strategies that are generated. How many pass the validation and how many trading strategies pass the Monte Carlo? And if the strategy passes everything that I’ve said, it will go into the Collection.

Number of Bitcoin trading strategies generated

And one last thing I wanted to mention, if I click on tools and I go to settings, I set it usually to close the trades at Friday close or at Friday to close all trades by 9:00 PM.

Different brokers close at different times on Fridays. Some will close at 10:00 PM, others at 11:00 PM, others at midnight. I put it at 9:00 PM. So it doesn’t matter what your broker uses as a closing hour, I want to make sure that you will not have trades left behind for the weekend.

Setting the trading session time in EA Studio
Setting the trading session time

Now, I will return to the Reactor and I will click on Start.

Again the generation process is very fast but you can notice the difference. Not so many Bitcoin trading strategies are going into the Collection now. Only 1 has passed everything. And it went in the Collection. You see a very nice equity line and as well, the Out of Sample test is profitable.

The Bitcoin trading strategy in the Collection
The Bitcoin trading strategy in the Collection

So what I will do? I will leave the Reactor running for 600 minutes, which is 10 hours. Something else that I will do right now is to open the very same EA Studio on the other 2 browsers and I will generate strategies at the same time for M30 and for M15. And not just on different tabs, but on separate browsers, because this way the software works faster.

This is one of the things that I liked most the first time when using EA Studio. You can run multiple Reactors on your computer on different browsers.

I will leave it now for H1. Then I will open 2 more browsers actually for M30 and M15. And in the Bitcoin Algorithmic Trading course, I show you how many Bitcoin trading strategies I have generated and what strategies we will have in the Collection.

Thank you, guys, for reading. I hope this lecture will be useful to you and will help you to understand how to generate simple and complex Bitcoin trading strategies in less than a day using the EA Studio strategy builder.

If you have enjoyed the lecture, share it across social media or just leave a comment below to show your appreciation.

I will see you in another lecture.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>