Waiting Night All Setting

Waiting Night All Setting

7 июня 2022, 10:14
Marat Baiburin
7 397

Friends, I have combined all my posts into one so that you can find here all the information you need on working with the Waiting Night Advisor.

Also in this message you will find the results of the multi-symbol test in mt5, the results of the mt4 test using TDS2. All tests were carried out taking into account slippage and commission.

The first and most important thing is to set up GMT and DST correctly

GMT - it is necessary to specify the broker's winter time.

DST - you must specify your broker's DST.

https://www.mql5.com/ru/blogs/post/743531 Here you will find detailed instructions for setting up GMT. If you do not know how to set the GMT time correctly, send me this screenshot from your terminal and I will tell you:


Simple parameters that do not require detailed explanations:

Panel Enabled - false/true - enable or disable the trading panel.

Magic - You can set any number for all pairs, as long as this number does not coincide with the magic number of other experts.

Comment – You can specify any comment convenient for you to recognize transactions in the history.

Trade Direction - open deals only for purchases/sales/everything.

Live mode and Tester Mode:

If you want to use the Expert Advisor only on the current chart, specify "Live mode - Single Symbol" in the settings. In this case, you need to attach an Expert Advisor to the chart of each pair you want to use.

If you want to use the Expert Advisor from one chart, specify "Live mode - Multi Symbol in the live mode settings and attach the Expert Advisor to EURUSD M5.

IMPORTANT: You need to add to the market overview all the currency pairs that you want to use.

In the fields Symbols [1] Symbols [2], Symbols [3] specify the currency pairs to be used in trading (they should be separated by a space).
Specify the currency pairs according to your broker's instructions.
If the broker uses EUR USD.r GBPUSD.r pairs, then you need to specify the pairs in the adviser settings.


If you don't want to use ALL currency pairs, specify only the ones you want. You can leave the other fields blank

If you use output parameters other than the standard ones, or for example you use special settings for icmarkets, you need to use the "Live Mode - Single Symbol" mode, then the Expert Advisor will use your input parameters and will be used only on those charts to which the Expert Advisor is attached.

"Live mode - Multi Symbol" works only with default input parameters.

When testing MT4, the terminal does not support multitesting of Expert Advisors, and the test will always be performed only on the symbol that you have run in the parameters.

When testing MT5, you can run the test on several pairs at once. The test will take a very long time - this is normal. The terminal synchronizes the tick data of several currencies, and it takes a lot of time.

In addition, when testing, you can choose - a Single Symbol test or a Multi Symbol test. The Single Symbol test will go faster. Therefore, if you are engaged in optimization, then you need to optimize in real time - Single Symbol

important: When using Multi Symbol, your trades may differ from Single Symbol mode, but not too much. This is due to the fact that the Expert Advisor needs more time to process each tick from one chart and analyze the market situation. It's all right. There may also be minor differences in actual transactions from transactions in the tester.

Lot Settings:

Lot type - If you have chosen a fixed lot, the EA will work with a fixed lot and will not change it depending on your deposit. If you have selected Automatic Lot Calculation, the EA will calculate the lot based on your balance or equity, depending on the selected next parameter.

Lot Calculation Balance/Equity — If automatic lot calculation is selected, then you need to specify which lot is calculated by balance or equity.

Lot fix /Lot per balance/equity – if the lot is fixed, specify a fixed volume. If an Automatic lot is selected, then specify the lot for automatic calculation.

The amount of the balance/quity to increase the lot – If the lot is set automatically, specify the step of increasing the lot.

Let's look at some examples.

If your deposit is, for example, $3,000 and you want to trade an automatic lot with 0.02 for every $100.

You need to specify this in the Adviser settings:

Then the EA will count as follows: 3000/100*0.02 = 0.6 – this will be the lot that will open trades. The calculation will be made in accordance with the balance. If the balance is, for example, 3425, then it will be calculated as follows: 3425/100*0.02= 0.68. Thus, your lot will be dynamic after each closed transaction, and you will see it on the panel.

You can also calculate your net worth. This is convenient if there are current open trades and you do not want to risk the entire deposit, but are ready to trade only with free funds (equity).

Fine-tuning risks:

Attention! When using these parameters, the number of transactions may decrease, and the results of your trade may differ compared to the default operation

Max orders opened – the maximum number of simultaneously open orders for all currency pairs. The Expert Advisor will count all orders opened on the account. If the number of open orders is more than available, the EA will ignore all new signals.

Max loss in % of the balance (0 -not use) - this is the maximum drawdown per night. Specify in %. If the maximum drawdown on closed trades during the night exceeds the specified percentage, waiting for the night will no longer lead to the opening of new trades that night. Attention: The Expert Advisor takes into account the drawdown on all transactions, even on transactions of other advisors installed on the account.

For example: if your balance is $1,000 and you do not want to open transactions, if you have lost more than 12% of your balance overnight, then you need to specify 12% in the settings. Then, if the balance reaches $880 per night, waiting for the night will not open any more transactions that night. But it will be sold the next night if you do not remove the Expert Advisor from the chart.

Max equity drawdown in % of the balance (0 -not use) - this is the maximum current allowable drawdown for opening new orders. If you want transactions not to be opened when a certain drawdown on open transactions is reached, specify this in %.

For example, your balance is $2,000 and you don't want new transactions to open if the drawdown on current transactions exceeds 3%, then specify 3%. Then, if the equity is below 1940, no new deals will be opened.

Attention: The Expert Advisor takes into account the drawdown on all transactions, even on transactions of other advisors installed on the account.

Close On Loss of Balance, % (0.0=disabled) - Close all trades opened by the Waiting Night Expert Advisor when the drawdown in % is reached.

If you do not want to allow a drawdown, for example, more than 5% on your account, you can specify this in the settings. Then, when the drawdown reaches 5%, all trades will be closed, but this will not prevent the adviser from opening new trades. 

For example, your balance is $100 and you don't want to lose more than 5%. When the equity reaches $95, all transactions will be closed at the current price.

Trade Sunday – включить/отключить торговлю в ночь с воскресенья на понедельник

Currency limits:

Enable Currency Limit – enable/disable the restriction for correlating pairs.

You can limit the number of transactions for each currency if you want to prevent correlated transactions. 

In the standard settings, the EA always opens trades if there are signals to open. In cases where there is news, for example, on AUD, the adviser can open several transactions: on EURUSD and AUDUSD. But if you specify a limit for AUD = 1, then only one AUD transaction will open, and other transactions with this currency will no longer open that night until the current transaction closes.

General Settings

In this section, the settings that affect the Expert Advisor's trading. By default, these parameters are specified "-1" - this means that the default parameters will be used in trading and testing, that is, the settings for each pair built into the Expert Advisor will be used.The standard parameters are selected for the purpose of minimal drawdown and profit factor. Optimization was carried out taking into account the floating current spread and slippage over a period of 10 years with the most accurate quotes - Dukascopy. 

You can use standard parameters or optimize them at your discretion:

When using your own settings, your trades will differ from the default operation of the Expert Advisor. Take the optimization issue responsibly. If you don't have enough experience, use a demo account to experiment.

On the other hand, it is important to understand that using your own settings is always an advantage:

✔️ Your transactions may differ from those of other users of this system - and this is great, as it can reduce slippage. Imagine that several thousand users open a deal at the same time - of course, some of them will have some slippage, and the deal will open at a less favorable price. We don't need it.

✔️ You can set up an Expert Advisor for your broker's quotes. This will help you to configure the Expert Advisor more precisely.

✔️ You can use different settings for trading - this is the right risk diversification

I ask you to pay attention to the stop loss settings:

At the moment, the stop loss settings for each pair are set individually from 500 to 1000 points. It seems to you that this is a lot, I understand. But during the rollover, the price makes strong jumps, but this can lead to a stop loss, and your deal will be unprofitable. Carefully check your settings on the demo account before installing them on a real account.

So, 5 optimization parameters are open in the Expert Advisor, as well as stop loss settings and a maximum spread filter.

Koef for TP (more 0.0, -1 - auto) - this parameter is responsible for exiting the transaction, that is, for dynamic take profit. Optimize this parameter from 0.01 to 3 in increments of 0.01

Level calculation  (more 0.0, -1 - auto) - responsible for the conclusion of the transaction. Optimize this parameter from 1 to 50 in increments of 1.

Koef calculation  (more 0.0, -1 - auto)  - transaction filtering. Optimize this parameter from 0.01 to 3 in increments of 0.01

Force 1 (more 0.0, -1 - auto)  - transaction filtering. Optimize this parameter from -50 to 50 in increments of 1

Force 2  (more 0.0, -1 - auto)  - transaction filtering. Optimize this parameter from -50 to 50 in increments of 1

❗️I recommend optimizing in the "Every tick based on real ticks" mode. But you can also optimize in 1-minute OHLC mode - it will be faster optimization, but not as accurate.

After selecting the currency pair and optimization mode, select the optimization parameters and specify the desired step, as shown in the screenshot below.
When everything is set up, you can start optimizing.

After the optimization is completed, you can select the result you like and save it in a specified file.

I know two ways to optimize:

1. You can optimize all three parameters at the same time. Using the md5 genetic algorithm, the optimizer will find good parameters according to your optimization criterion.

2. You can optimize each parameter separately in turn for several cycles - this is a more fine-tuning that requires some experience.

A few tips from my experience:

The longer the optimization period, the better the result will be. Do not accept optimization deadlines of less than 3 years.

Try to optimize the last period. For example, if you want to optimize the Expert Advisor for the last 4 years and test it on forward testing, then optimize from 2018-2021 and check from 2014 to 2018. It will be better if the Expert Advisor is configured for the current market.

Try to choose the best options from those found. Pay attention not only to the profit, but also to the drawdown, the profit coefficient and the recovery coefficient.

I recommend using the MT5 version for optimization, as mt5 has the ability to optimize through the MQL cloud, which significantly speeds up the process. There is no need to buy the MT5 version. You can use the MT5 demo version for optimization and use these parameters in the MT4 version.

A nice bonus for more advanced users:

The Expert Advisor also contains my personal optimization criterion, according to which you can also find good parameters. This is convenient because it takes into account both the profit ratio and profit.

In case of errors/questions:

If you have any difficulties with the work of a consultant (for example, you have no deals or they are all unprofitable) - write to me. But without information, I can't help you. Give me a full detailed answer to each question:

1. Who is your broker?

2. Are you using an ECN RAW RAZOR account?

3. What GMT time have you set?

4. What currency pairs do you use?

5. What is the ping of your terminal? https://www.mql5.com/ru/blogs/post/745225 - this article will help you determine the ping

6. Attach the expert journal. https://www.mql5.com/ru/blogs/post/745222

With the full information I have received, I can help you quickly and efficiently.

in general, if you set the time correctly, you are using the ECN RAW RAZOR account, and your ping is less than 50, and you are using all currency pairs = your total transaction should be similar to my signal. Trades may differ, as each broker has different quotes and different ticks - this is scalping, and this is normal.

Please feel free to contact me with any questions. I'm always happy to help you.