Hello dear users, let’s continue with our
tutorial! Welcome back! In that tutorial we will crate a strategy for the EURUSD market
15 minutes and if you remember from the previous episode we imported data from our broker.
We will use that data now. I will open a new strategy. As I said before I can open a new
strategy from here but if I use this button it opens a default one but I already saved
a template. I will use that template. What do I have here? First I will set the initial
settings of the strategy and later I will use the Generator to generate. When I am in
the Generator I have here several settings panels but I can change only the Generator
behaviour and I cannot change anything in the strategy directly from the Generator so
first I have to go in the Editor page and here to set the initial properties. What do
we have here? “Unit for trading amount” – I will use Lot. Entry amount for a new position
– 0.1 and Maximum position amount – here, if the strategy uses adding, the amount of
the strategy (the open lots) will increase and here I set the maximum open lots to be
0.4. Next same direction signal – this is the adding behaviour. I leave it off and let
Generator decide what to do. I have here 0.1 adding lots. This is for the opposite signal.
Here I set the reducing behaviour. I will keep it at Nothing and Amount for reducing
– 0.1 – let the Generator decide. Here I can set Stop Loss, Take Profit and Break Even,
but I will not set them now. Let’s confirm. So before generating, the most important things
are: the Trading Amount, the Market, Profile and Data Source. They are what I want because
I used the template. And here I have to set the Collection. When I am working with the
program I can add strategies here to a collection manually and when the Generator is working
it also adds strategies to a collection and I will name that collection “Active” is the
name of the broker, EURUSD 15 minutes – “M15”. OK, this is the name of the collection. That’s
all here. Let’s go to Generator. And let’s see the generator properties! This is the
common options of the Generator. I can open this panel from here or from this Strategy
Properties panel. When I click this tile it opens the common options. It’s a little bit
different in the editor. When I click here it opens Strategy Properties but when I open
the Generator it opens the Common Options, because of this in the Generator I cannot
change the properties directly. And what do I have? Same direction signal. Here I set
what I want the Generator to change during the generating process and I want it to change
the same directions signal behaviour. This is the adding behaviour. When I click on this
option, when the options is on, the Generator decides when to use adding, winner option,
loser or nothing. Let’s do the same for the Opposite Signal – this is the reduction behaviour.
Here I can set the Stop Loss, Take Profit and Break Even behaviour of the Generator.
I have here four options: Keep Original means that the Generator will not change the Stop
Loss; Always Use means the Generator will always try to find the best Stop Loss for
the strategy; I will keep this May Use option. That means the Generator will decide whether
to use Stop Loss or not and I can set here a range for the Stop Loss. These options here
are in Points like all options in Forex Strategy Builder. How much to set? Let’s set.. for
Stop Lost let’s put 20 pips. I set here 200 points because my broker is five digits and
the maximum set it to 200 pips. Let’s leave it like that. I’ll do the same for the Take
Profit: May Use and I will here set the same range. Break Even – I don’t want Break Even.
So Maximum count of slots. Here I set how many indicators to generate in the Generator.
We have two slots that are constant. They are persisting all the time: Opening Point
of the Position and Closing Point of the Position but the Generator can add additional indicator
slots for filtering the entries and for figuring the exit. And how much to set here? Before
it was t but I will set … I want to use between two and four. I don’t need too much.
Let’s set three and for closing slots. Closing slots are available when closing indicator
is Bar Closing. OK, let’s make it four to two. I’ll close that and before we start let’s
check the settings. OK these settings I have to set only once. What I have – Search best:
Net Balance, System quality number, Sharpe, it’s different options. I will keep it simple.
Let’s put Net balance. Working time in minutes – I will increase that option. Let’s make
it sixty minutes. So I’ll check Acceptance Criteria. I will leave this options to the
default values to start the Generator and during the working I will explain the next
settings. So I have the collection and the is OK. Let’s run the Generator. Now the generator
tries to find strategies. What it does is to generate random indicators and try fulfil
our criteria and our initial settings. Let’s talk about the acceptance criteria. When I
go to settings I have the option “Strategy fulfills acceptance criteria” and I can change
the Acceptance Criteria in the Control Panel. I will go there. The Generator is working
here in a separate tab. I see it already generated one strategy. This is our Acceptance Criteria.
This Generator is already started so if I change the Criteria they will not reflect
on that strategy, but it will reflect on the next one. Let’s see what we have here: these
are the default settings, if we make any changes you can use this Reset button to reset the
Acceptance Criteria to the default. And what do we have? Maximum ambiguous bars – ambiguous
bars are bars where the Generator is not sure how exactly to route the price. If you have
two orders in a bar, the program is not sure what order to execute first – the lower or
the higher if it (the price) started between them. The program marks such bars as ambiguous.
So we have here maximum of ten ambiguous bars. I will show you later how to deal with the
ambiguous bars. Here we have Minimum profit per day in currency. Our currency is Euro
and that means the Generator will search for a strategy that makes a minimum of one Euro
per day. What do we have? Minimum count of trades. So the Generator must find a strategy
that trades a minimum of one hundred times. That option is good because with a small number
of trades we cannot decide if a strategy is good or not. For example it can make only
two or three trades and we cannot decide what are the general stats. What we have here?
It has collected some strategies – seven. Let’s see how the collections work. When the
Generator works it generates strategies and sends the strategies to a collection. We can
see the collections in the Repository tab. When I click the Repository it opens in a
separate tab page and we have here three sub-pages. The first one is the Collection. When the
Generator works it pushes strategies to that Collection and we can see here the strategies.
A collection can contain maximum up to 100 strategies. And we can arrange these strategies
using different criteria. For this is the Net balance, System quality number, Sharpe
ratio and also we can filter the strategies this is the minimum Sharpe ratio. We can use
different filters. So we have to keep the generator running, until it finds more strategies.
What we can do is to start another Generator. How to do that? I will use the template to
open a new strategy. Let’s check if everything is OK! Ok.. no.. I have here a different Collection.
I will use the same collection for this strategy. What was the name? “Active EURUSD M15” so
both Generators are to push the strategies in the same Collection – “Active EURUSD M15”
and I will start the Generator. This is another copy of the Generator. It must use the same
settings. I will tell you something about the settings.. OK let’s start this also! Now
we have two running Generators and both will push the strategies in the same Collection
– that one. When I am in the Generator and I am changing some settings – for example
like that one. I have two options to close this settings panel. I close it from here
or from this “OK” button and there is a small difference between both buttons. If I use
that button, the changes are saved only in the local strategy. If I change that one – if
I remove the “Strategy fulfills acceptance criteria” option and close from “OK” will
also have that option off. If I change some options and close only from here these changes
are local and the next strategy will not be affected. You see? Here these are on and here
are off. This is a little trick. Let’s see what happens with our Generator. It already
generated twenty one strategies. I’ll wait more. OK, what can we do now? Both Generators
are generating strategies and I can see these strategies here. For example.. Let’s find
some interesting. I don’t like this, I don’t like this one. I will delete it. It’s useless
to keep it… where is it? Okay, that one, click Delete. By pressing the Delete button
I am removing the strategy from the collection. This one also is not good. I don’t see here
a good strategy. Let’s see that one. I can see the strategy slots here – the indicators
and I can see the statistics of the strategy. When I click on a strategy the program recalculates
this strategy and shows the statistics here on the right side. From here I can open, by
clicking this Open button or by double-clicking on the strategy. I can open the strategy in
a new tab to check it. This strategy is that one. this is a very simple strategy. It opens
at Previous Bar Opening and closes at Take Profit. We have also stop loss, here – Take
Profit. Why is that? Here I have 223 pips. Here is… Let’s make it 3000. OK. Why have
here 3000. I set in the Generator to generate Take Profit between 200 and 2000 but I have
here Take Profit 3000. That’s because this is a different way to set Take Profit. I can
set Take Profit here in the Strategy Properties but I can set it also in the strategy as an
indicator and because probably the Generator cannot set here more than 2000 it finds a
random-listed Take Profit indicator and set it here to 3000. Let’s see what we have here!
Hmmm-hm-hm we have 23 pips, let’s try with Stop Loss 30 pips. What will change? Ah that’s
no good. 23..If I make a very small change in the Stop Loss the strategy behaviour changes.
Most likely it works well with smaller Stop Loss. Let’s keep it 25 pips. Our program becomes
a little bit slower because this two Generators are running. Collected 9, 28. Let’s see in
the Repository what we have! Do we have a better strategy? No, we don’t. I’ll continue
working with that one. I don’t like the strategy too much. Why does it open at previous bar?
What will happen if we open in that bar? Bar opening, no, it’s not working. Actually I
don’t like this strategy and I’ll close it. Let’s see what we have: Calculated 1000 strategies,
collected 13 and here created 31. I will pause the video recording and keep the Generator
running and I will resume the Generator later when we have more generated strategies. I
actually, before starting the recording, generated a good strategy. Let’s see if we can “repeat”
it. What I already saved is.. well it’s not here. Can I open a strategy like that? I generated/prepared
two strategies: that one – strategy
one and strategy two. Let’s see what I already have. Let’s see that strategy. This strategy
opens 0.1 lot and adds to open position 0.1 and the program allows maximum 0.4 lots. Actually
it opens (zero point) one lot and adds three times we have Stop Loss 100 pips and here
is 1000 points. The strategy opens a position at Bar Opening and closes at Day Closing.
When I used the Generator it used the Day Closing but Day Closing has a problem on Friday
because the normal Forex day closes at 24:00 but for the Friday it’s different. It depends
on the time zone. Let’s see my broker – when it closes the position on Friday. Actually
today is Saturday and the market is closed. This is the last bar and in this fifteen-minute
chart the bar opened at 22:45, that means the broker closes at 23:00 and if I use here
Day Closing the program/the strategy will not close the position on Friday because it
will wait until 24:00 but my market closes at 23 so I am using Day Closing indicator
and I will set here different times for closing the position. What do I have by default? For
every day I have closing at 23 and 59 minutes but for Friday I can set different hour. I
will set here 22 and 59 so the strategy will close the position at 22:59, one minute before
the closing of the market. I’ll make it 55 to have 5 minutes. What more do we have? It
opens at Bar Opening. Bar Opening is the opening point of the position and we have only one
Opening Point for long and for short position and that’s why we don’t have ambiguous bars.
This is very good. We have two filters – Moving Average Crossover. Fast Moving Average is
lower than slow Moving Average. What does that mean? Actually this is not a trigger,
this is a filter, because if the condition was “crosses” (Fast Moving Average crosses
Slow Moving Average) this would be an event would trigger the entry but actually it only
allows the entry. You can see that on the chart. Where do we have entries? I want to
see Moving Average on the screen. What we see is that obviously the yellow one is the
faster Moving Average. When the faster Moving Average is below the slower it allows long
entry and here we have the same – the faster Moving Average is below the slower. What we
have here are four entries. One, two, three, four entries. And we will close the position
of the end of the day. What is that? 23, do you see here? 23:45. It is the last bar. But
what time it opens? It opens at 3:00. Why? Because of the other… Let’s see the other
indicator. Fisher Transform. What do we have? Fisher Transform is lower than the zero line.
So in order to open a position we have two conditions Moving Average – The faster Moving
Average is below the slow one (to open long) or the Fisher Transform is lower than zero
but indicators must give permission for opening and here we have the faster Moving Average
above the slower and Fisher Transform is higher than zero. That’s why we have a short position,
but what I see here – we add 3 times at three consecutive bars. What if instead of adding
three times I open at once 0.4 lots? Why do I need to add three times? Let’s see if it
would change something. OK here we have also three consecutive additions. So instead of
adding I will change that to 0.4 and I will remove that and I see even the strategy performance
now is better. So I will not use the adding. I will keep (it) like that. I will save the
strategy to not lose it. I’ll save.. where to save.. to my Desktop. Because I dragged
it from my Desktop… OK I will save it there. Let’s see what more we have here. Maximum
stagnation – 91 days. Stagnation is the period when the strategy doesnt make a new profit.
For example it reaches here the highest balance but after that it start losing and here it
makes profit until it reaches this peak here, and this period from here to here is stagnation.
It also has stagnation from here to here and from here to here. And the maximum period
is three months. It’s not too bad because for that tutorial I make eight strategies
and I use these eight strategies to trade in a portfolio. Let’s see what the Generators
have. This collection – 29, this collection – 43. Let’s see the Repository, do I have
something good? Maybe that one. OK. Let’s continue with that strategy. What we can do
more? We don’t see ambiguous bars. That’s very good. But anyway, I can go to Comparator
to be sure 100%, because we have different interpolation methods/backtesting methods/
and the default one is the Pessimistic but when I change the methods the program uses
different rules inside the strategy and there is a slight possibility that another method
will find ambiguous bars. Actually this is not our case. No problem and I have here Monte
Carlo tool. Monte Carlo makes some noise in the data and in the environment. It tries
to make some changes to prevent the normal work of the strategy and the trading. It simulates
trading flaws and I have here several options. The first one is “Randomize history data”
/the first group/ and “Randomize spread”. Let’s make some simulations. I can set here
how many simulations to make – 20, 20 tests with different simulations. Let’s see what
will happen! I’ll run that. Let’s see… That data took very well. It seems that if the
market is slightly changed the strategy is going to lose. That’s not good. That means
that the strategy is overoptimized. See the result! Let’s see what we have in the Confidence
Table. What is so bad in that strategy? Let’s see if the Spread or the Randomize history
data is the problem! Ah! Okay! The randomization of the history data is not a problem. Even
what I see is that the randomization of the data doesn’t have any effect on the strategy
performance but when I’m randomizing the spread the strategy starts losing. Let’s see what
options I have: Spread range in points – between 10 and 30. How much, how is my Spread in the
settings? This is the ActiveTrades profile and I go to Control Panel. I have to go to
Symbol, EURUSD. My Spread is 8 points. Let’s let a higher spread – 10 points and see what
will happen here! There is no big effect. And let’s set 20. When the Spread is 20 pips
the strategy starts losing. What I can do? Let’s return that to 10 pips! I keep it 10
pips or 8 – it was the original. OK. What I can do is prevent trading when the spread
is higher than 10 pips. How I can do that? We have an indicator. A custom indicator called
Spread Level Pro, I think. I am not sure I have this indicator set. Let’s see what custom
indicators I have! The computer became slow because of the running Generator. We go to
Indicators. Yes I have this Spread Level Pro. We can download the indicators in the Repository->Indicators.
Now the program will reload the index. And we can find it here. Let’s sort by title!
Where is the spread level? Spread Level Pro.. OK, we see here some indicators have this
MQL icon and some indicators – don’t have (it). When the indicator has this MQL icon
that means this indicator has MQL code and may be used for exporting Expert Advisors
and this Spread Level Pro has MQL code so I can use this indicator in my strategy and
I will add this as an additional filter: Spread Level Pro. This indicator is working only
on… this indicator works properly only on trader mode. That means — in the backtester
mode we have a fixed spread and that spread is 8 pips but in trading mode the spread depends
from the broker, from the dynamic of the trade, from the market. And I don’t want to trade
when the spread is higher that the predetermined level. The spread is lower than the selected
level. This is a symmetrical condition. This means that when the spread is lower than 20
points the indicator allows opening a long and a short position. How much to set? Let’s
set 12 points! And that filter doesn’t effect my strategy in the backtesting mode but this
will prevent entries when the Spread is higher than 12. I will save that. So you see how
useful was this Monte Carlo tool. Let’s remove that indicator for now and continue with Monte
Carlo check! Let’s set random spread between 8 and 12.
That means that the Spread will be for every trade, for every deal will be randomized.
Let’s test what we have here! Everything is good so i set, I will use maximum 12 points
for the spread and my strategy should work well. What are the other options? Randomize
history data. Number of changed bars – 20% of the bars and the range – Average True Range
changes 20%. OK. Let’s check with Randomizing history data and Randomizing the Spread and
also the strategy is working well. That’s good. The other option is Randomly skip position
entries. This group of settings, they simulate flaws in the execution — trading flaws. So
“Randomly skip position entries” will skip an opening and “Randomly skip position exits”
will skip an exit. “Randomly close positions” means the broker can close position randomly
before our closing order. And “Randomize slippage” – let’s see what will happen here! I will
remove that one, that option. What I have for the slippage? Slippage – from zero to
five points. OK. Let’s see! Hm! It’s not working very good. What if our strategy misses an
exit point and will close the position in the next day. Let’s remove the Slippage and
the Randomly close position, Randomly skip position exits. OK, let’s keep the first option
only! What happens if we skip position exits? Is
it the problem? No, this is not a big problem.
So what we have if our broker misses a signal, (fails to) to execute the signal. This all
may arise in different situations for example if we have problems with our internet connection
or with our computer it may miss some entry or exit. Let’s keep this simulation – Randomize
history data, Randomize spread, skip position entries and skip position exits and see what
will happen here! Everything is OK. I think the problem is from the Randomly close positions,
because we open 0.4 lots and we are using a 15 minutes chart. Let’s go to the chart!
Let’s see here in the Journal what we have! We’re opening trade during the day only and
where is our indicator chart? For example we’re opening a position here but if I use
this Randomly close a position before the end of the day and the position doesn’t have
time to develop profit. This Monte Carlo tool is very useful to analyse our strategy behaviour.
This third group of options is for randomizing strategy’s indicator parameters. Let’s see
what we have here. We’re not going to change our strategy but anyway this is a test for
overoptimization also. We see here that the strategy fails. What options do we have? Indicators
parameters change 20%. Indicator param. maximum change. So at every test there is a chance
of 20% to change the parameter and if the Monte Carlo tool decides to change the parameter
is will set to maximum 20% of change. Let’s go to the Editor. I’ll remove that Spread
Level Pro.. no, let’s keep it. Let’s try changing Moving Average Crossover. What will happen
if I change something? Yes, it’s OK. Fast MA is lower than Slow MA. Why I have so..
I will delete here “Shift”. If I remove that shift what will happen? Nothing. Let’s cancel
that. Medium. Let’s make it Close! No! It looks like this indicator is overoptimized.
Let’s change that parameter! Well, this is OK. This is OK. Let’s see here the Fisher
Transform – period of 71. Base price – Open. Why Open? Let’s make it Close! Yeah, it’s
OK, nothing changed! And the period is 71. Why 71? Let’s make it 50! No, it’s not working.
Let’s increase it. 60? 60 is OK. 60 is OK. 65? It’s OK. 70? 71 is OK, 75? Also. 76…
what happened? Mhm..78, 80. This is also OK. I will return to 70 to be a round number and
I will try to make this MA Crossover also round numbers. Let’s make it 60. It’s all
the same 65, 26, .. OK I’ll leave it. So I think this strategy’s ready for trading. I’ll
save it. This is EURUSD M15, strategy number two. I will save it under another name. And
name to use? Um… Ready. OK. On Monday I will strategy on my account but we remove
adding and actually the strategy opens one position only until the end of the day and
most probably it will open somewhere at the beginning of the day. That means the initial
amount is not important. So actually I can change that one and it will not change the
strategy behaviour. It will change the final balance, because I am reducing the amount
but if I change that it won’t change anything in the strategy because it doesn’t change
the logic. It is only the amount. So I will test that strategy with 0.1 lot because I
want to run eight strategies. Also this is 0.1. actually this is not important because
I don’t have adding. I have stop loss. I want to run 8 strategies on my account, to make
a portfolio of strategies and that one will be the first and since this will be the first
one I’ll change the name again. It’ll be Strategy EURUSD 1st and I will find a second strategy.
I will run two strategies for every major symbol and I will do that in two days because
today is Saturday. The Forex strategy is ready. I will make another one from these generated
(ones). I’ll end this episode now. I have one strategy ready and in the next episode
I will check this generated strategies and we’ll try to find another one strategy for
EURUSD market and later we’ll continue with finding strategies for other major symbols.
So thanks for watching this episode and we’ll continue in the next one. If you like this
series, please subscribe to our YouTube channel. Thank you for watching! Bye-bye!