Forex algo software robustness testing

Hello, dear students, I continue now with
the robustness of the strategies when we are using Strategy Builders. The problem
with Meta Trader is that you can test the robustness of a strategy after you have
it. OK? After you have bought the Expert Advisor, after you have paid the
developer to do it or after you have spent a couple of weeks to code it by
yourself. And just then you can do the backtest
and to check the robustness, as I showed in the previous lecture. Now when we have
Strategy Builder, we test the robustness before we have the Expert Advisor, just
when we have the strategy, the idea of the strategy. And we can see if it is
worth to do it as an Expert Advisor. And actually with the Strategy Builders, it
is very easy to have it as an Expert Advisor because we don’t need to have
any programming skills or any trading experience even. With one click we can
export it as an Expert Advisor and I will show you how to do that. Alright?
Now when we are having Strategy Builders, we have different robustness tools that
we will use. And in this course, I will show you 3 of them; the Walk Forward
validation, the Monte Carlo tool and Multi-Markets. These 3 are different tools
to validate your strategies and to check if they are over optimized or not. Now on
our website, we have 2 Strategy Builders; one is EA studio or Expert
Advisor Studio, the other one is Forex Strategy Builder. Now Forex strategy
Builder needs to be installed on the computer. It’s a little bit of a heavier
program, takes a little bit longer time to get used with it. I can say these two
are just different software. I get the question all the time, “What is the
difference between these two?” They simply create different Expert Advisors and they
have some different features inside. But the idea is one and the same with both.
We are building strategies, Expert Advisors, we export the strategies as
Expert Advisors with one click so no programming skills are needed or even
no trading experience is needed. You can generate strategies based on the
historical data, which I will show you how to place in the Strategy Builder. Now
Expert Advisor Studio comes with 15 days free trial which you can use and during
this time you can export or generate as many Expert Advisors as you wish. There are
no limitations here. I will click on “login” just to use it and I will just
demonstrate to you how I will use this Strategy Builder to test the robustness
for the strategies. So if I click on “strategy,” you can see that I have the
possibility to put entry conditions and to put exit conditions. So if you have a
manual strategy that you are trading and you want to use it with Expert Advisor,
you can build your strategy here. Now I will demonstrate it to you very quickly.
Let me take randomly some indicators, for example, I will select what is it, I have
many indicators here but let’s pick some randomly money flow index. For example,
there are different conditions, money flow index rises, falls, is higher than
the level line, is lower than the level line.
Let’s take money flow index falls. And I will click on “accept” and you will see
that immediately I have a dramatic loss. So basically here is the backtest. OK? For
this period that we have, from October 2017
till today 5th of March, 2019. OK? So whatever indicator I place or add to the
strategy, I will see immediately the backtest result or the
balance chart. Now let me place some exit condition as well. I will take, for
example here, some of the indicators that I like the most. I will take the
envelopes and here is the rule we have the bar opens above upper band, the
bar opens below lower band, the bar opens below upper band after opening above it…let’s click on some of it randomly. I will click on “accept” and actually here
you see I have a profitable strategy. I took these indicators really randomly.
Just from my experience, I know which indicators are good entry and exit
condition. I didn’t place even a Stop Loss and Take Profit and you can see
this strategy is on profit. Even if there was a huge Drawdown, still this strategy
is on profit. And now what is the thing here guys, that whatever change I make in
the indicators, I will see the effect immediately on the balance chart. So let
me, for example, change the rule, the bar opens above upper band and I will click
on “accept.” And here I have a much better strategy. Even recently losing, you can
see the equity line is much smoother but for the recent period it’s losing. OK? And
let me change some of the periods. So, for example, from 14 I will go up to 15 and I
will click on “accept” and you see there is a small change. And I will go up to 20
and I will click on “accept” and you see it’s getting actually worse. Alright? Now
I can add as well Stop Loss and Take Profit. For example, let’s add Stop Loss
of 50 pips and Take Profit of 100 pips and I click on “accept” and you see there
was a small change. So this thing really saves us time. If you have manual
strategy, you really don’t need to test it a long time on a Demo account. What
you can do is simply to build your strategy here and see what was the
performance for the last months, for the last one year or even more, if you load
more historical data. And now talking about data, I will show you how to place
the data over here. I click on “data” and you see here is a drop zone, drop the files
here or click to upload. So let me get the files. I go to file open, data folder,
go to MQL 4 and here are the files. This is the historical data that I have
exported earlier. OK? What I will do, I will drop it in this window right over
here. I will just drag it and drop it and you see the data is imported and
uploaded. Now whatever broker you see on my trading courses, guys, please don’t take
it as a recommendation. We are not connected to any of the brokers. But, of
course, I have to choose one to record the courses and I’m always looking for
the regulated brokers. I dedicated many lectures in my courses how to choose the
broker and basically how to avoid the scam brokers because this is the most
important thing nowadays since there are really many scam brokers around. You can
read more about it in our forum, it’s free. There is such a topic called “how to
recognize the scam brokers” which will help you to identify them. Alright?
Now going back to the strategy, we said that here we can build a strategy and
immediately we can see the balance chart or the back test. OK? We have report where
we see detailed statistics about the strategy, the backtest output such as
balance line stability, maximum Drawdown, months on profit, net balance and actually
let’s get back to this better strategy that I took
randomly. It was actually using the envelopes, the bar opens above the upper
band and I will remove the Stop Loss and the Take Profit. Now still I did a change,
what was it it was 14 I think. I will click on “accept.” Yeah, OK so this is a
little bit of a better strategy that I got here. So in the report
you can see that you have some statistics such as count of entries by
weekdays, profit and loss in currency by weekdays, here you have it by hour, entry
and exit hour. We have count of entries, profits and losses by entry hour and
monthly performance is below which is very interesting as well. Now we have the
journal, same as with Meta Trader, where we can see all the trades that were opened
and closed. And actually from here if I go to strategy one more time and I just
uploaded the historical data, if you upload your historical data you
will see it somewhere over here. So this is the one that I uploaded, you can see a
very small difference right in my balance chart. Now if you upload
historical data from the different brokers and you see a huge difference when
you change the server, this means simply that the brokers provide different
quotes. OK? Different prices, which forms different historical data but the
strategy is the same. OK? On the left side we have the indicator chart which is
something very interesting to me. Here we have where the trade was opened, where it
was closed, so if we have the green line this is a long trade, if we have the red
line this is the short trade. So you see here we have a buy position until
here, then here we have the entry condition for short and then here we
have it for long. You can see when the price touches these envelopes. Actually
to be precise, we set the bar opens above upper band, this is the exit condition for
the long trade. OK? So when we have a long trade and a bar opens above the upper
band, it closes the trade. Right? And our entry condition is with the money flow index.
In this case we say the money flow index falls. Alright, guys? so this is how you
can build a strategy over here and the best thing with a Strategy Builder, that I always say, is that with one click we can export this
strategy as an Expert Advisor. You can see if I open it, you will have the code
for the Expert Advisor already without mistakes and you can compile it.
Alright? So we have the Expert Advisor ready to use and if you want to do it
for Meta Trader 5 you can export it as well for Meta Trader 5. Alright? So let’s
make a quick check with the Meta Trader. I will copy that, I will minimize it and I
will paste the Expert Advisor. So I go to open data folder and I go to MQL 4
experts and here I will paste it. So this is the one with 343
ending magic number, I will open it. OK? Let me compile it first. I click on
“compile,” you can see there are zero errors, zero warnings which means that
the code is just fine. And now I will see it right over here if I click on refresh,
it is this one right here. OK? Now I am on USDCAD, I will drag the Expert
Advisor over the chart, I will click on “OK” and let me backtest it. I will go to
Expert Advisors, strategy tester, open prices. We have the date for the last 1
year and 15 current spread and I click on “start” and let’s see what is the
result. Over here it’s 11,137, the graph you can see, it’s the very same graph recently
losing in this zone. The very same thing what we had here, but here it’s just in a
small window while in Meta Trader it’s quite bigger. And if you compare the
results with the open and close trades, you will see that these are the very same
trades that were open and closed. Could be a small difference because of the
spread. Because here I entered current spread and when we export the historical
data, I use 10 points because I rounded it to the high
number. But anyway guys, this is the way that you can check if the Expert
Advisors created with the Strategy Builder are real, are showing the very
same backtest what we have in Meta Trader. And this way you can see if a
Strategy Builder is actually reliable or not. Of course, I have tested that
many times and there are thousands of traders who use these Strategy Builders.
So it’s tested, all bugs were fixed a long time ago and actually it works really
nice. Now what we have here, more with the Strategy Builder, we have the generator.
The generator is the smart thing or I can say the intelligence that stands
behind this Strategy Builder. Because with the generator over the historical
data that we use and that we imported from our broker, we select the symbol, the
period and we can select what range to have for our Stop Loss, for Take Profit,
if we want to use it or not, if we want to use trailing Stop Loss or not. And we
have some generator settings and when we click on “start,” I will just click on
start randomly without making any setup here, you can see that there are
strategies generated. OK? You can see what is the speed of the Strategy Builder. It
calculates really fast strategies and all of the strategies calculated, you
will see them in the collection. So even if you don’t have any strategies profitable,
you can generate your strategies over here. And these are the very same
realistic strategies. If I click on any of those, you will see the entry and exit
conditions, the balance chart, the indicator chart and everything else. So this way,
with the generator we can create our own Expert Advisors. You can see this
strategy has a really nice profit line. OK? Balance line. We have the force
index, average true range for entry conditions, average true range for exit
condition and we have Stop Loss and Take Profit with the strategy.
OK? So this is how you can generate strategies. Of course, you need to set up
some limitations because you can see it calculated thousands of strategies and
we have hundreds of strategies into the collection. Actually in the collection we
see the best 100 strategies. But here in the generator settings where we set
working minutes, so for example, you can run it for 10 hours like I normally do
before I go to sleep. I run it and then in the morning I have already strategies
to work on. And then I download them, I download the complete collection and I
run it again for another 10 hours. So this way, I make it work all the time for me.
Let me stop it. So here in the generator settings, we have this common Acceptance
criteria. So here we place limitations. OK? We place criteria for this strategy.
So we don’t want to see hundreds of strategies that are just randomly
generated, we want to see strategies that perform well, that have a good Profit
Factor, R-squared or they don’t have a huge stagnation. We want to see many
count of trades because this is very important. The more trades we have, the
more robust strategy it will be. Because we don’t want to base our trading on
strategies that were showing backtest only with 100 count of trades, for
example, or 200. We want to see at least 300 – 350. If it is more, of course, it’s
better because imagine we have a strategy that performed in the past and
when we have more count of trades, it means that this strategy was executed
more times in the past. OK? So if it was executed only 100 times, obviously the
chance to fail in the future is bigger because it was tested, we can say, just
100 times. Even test is not the right word. Or we can say the strategy was
executed only 100 times. And if it was executed like 400
times, 500 even, 700 times, obviously this will give us a sign that probably this
strategy will continue working profitably in the future. And what else
we have are these robustness tools that are called Walk Forward, Monte Carlo,
Multi-Market. OK? These are different robustness
tools that I will cover in the next lectures and I will show you how I’m
using them in order to filter the strategies and to test the strategies
even before I am exporting them as Expert Advisor OK? I’m testing them over
here and if I see that they perform well with these criteria, just then I will
give them a try trading. Alright? Thank you guys for watching the lecture, and I
will continue with the next one. Cheers.

Leave a Reply

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