Error in MT5 4806

I did a merge of several strategies, it works wonderfully.
After a while, I generate new strategy.
I took back my old strategy that I put in the same databank that I merged into 1 strategy.

Now I have a "Failed to copy from indicator ... Error 4806" error.
he tells me that these are the indexes: 56, 11, 28, 38, 53 (See Attachment)


After several searches I find what are the errors thanks to the step by step mode. I realize that the cursor returns to these variables which break problem (4).
LongEntrySignal40 = (((changesUp(ADX_21, 1, 1)
ShortEntrySignal40 = (((changesUp(ADX_21, 1, 2)
LongEntrySignal39 = (((((sqIsFalling(BOLLINGERBANDS_9, 3, false, 2 + 1, 1 + 1))
ShortEntrySignal33 = (((((NormalizeDouble((double) sqGetIndicatorValue(QQE_6, 1, 3), 6) == NormalizeDouble((double) 645354175, 6))


Attachments
Portfolio.ex5
(2.15 MiB)
Portfolio.mq5
(721.05 KiB)
Portfolio.sqx
(2.11 MiB)
Journal.png
(29.87 KiB)
  • Votes +2
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

AD
#1

Siuko

20.05.2021 09:06

Task created

AD
#2

Siuko

20.05.2021 09:07
Following Tomas' instructions, I replaced the Subchart symbols with their real symbol: "EURUSD" and _Symbol
Don't work
AD
#3

Siuko

20.05.2021 09:27

Attachment Portfolio no bug first version.ex5 added

Attachment Portfolio no bug first version.mq5 added

Attachment Portfolio no bug first version.sqx added

Portfolio no bug first version.mq5
(384.45 KiB)
Portfolio no bug first version.sqx
(664.59 KiB)
Portfolio no bug first version.ex5
(913.17 KiB)

I forgot to specify that the line of code that I put which poses a problem are the same as in my first merge which never returned an error.

I made the comparison to see if there was any difference but I found none ...
Attached my first version which contains the lines that break problem, but I have no error with ...

TB
#4

Tomas Brynda

20.05.2021 10:57

Status changed from New to Refused

Hi Siuko,

the problem is you use different timeframes in the merged strategy.

You should create a merged portfolio only from strategies with the same symbol and timeframe.

Otherwise you may experience those errors 4806.


Also our MQL code is not prepared to handle multiple timeframes correctly. 

In OnTick method we take into account only the timeframe of the chart the EA is attached to.


Best regards,

Tomas


AD
#5

Siuko

20.05.2021 11:06

I just generated the strategies in multi timeframe WITH M15, H1 and H4.

So the strategies are on the same timeframe to process the trades.


What I don't understand is that it works very well with the first version ...


How can we add the code to unlock the situation?

AD
#6

Siuko

20.05.2021 11:15
I look all handle with the problem is on the same timeframe and is the timeframe of the main chart.

ADX_21 --> indicatorHandles[ADX_21] = iCustom(correctSymbol(Subchart1Symbol),TFMigrate(Subchart1Timeframe), "::Indicators\\SqADX.ex5", DIPeriod);
BOLLINGERBANDS_9 --> indicatorHandles[BOLLINGERBANDS_9] = iBands(correctSymbol(Subchart1Symbol),TFMigrate(Subchart1Timeframe), BollingerBandsPrd5, 0, 2.9, PRICE_LOW);
QQE_6 --> indicatorHandles[QQE_6] = iCustom(correctSymbol(Subchart1Symbol),TFMigrate(Subchart1Timeframe), "::Indicators\\SqQQE.ex5", QQERSIPeriod3, QQEsF3, 2.04, 1);
TB
#7

Tomas Brynda

20.05.2021 11:58

Status changed from Refused to In progress

TB
#8

Tomas Brynda

20.05.2021 14:31
Ok it is completely fine if you merged together strategies with the same chart setup.


I tried to run your portfolio on my demo account and it behaves normally, no errors so far.

I think the problem is your MetaTrader doesn't have the data it needs to compute indicator values.

AD
#9

Siuko

20.05.2021 14:46

Attachment Capture2.png added

Capture2.png
(76.91 KiB)

But there is something that I do not understand.

I have in my version 12 strategies merge into 1.


I have no errors with this version 1.


In version 2 I have 40 strategies including the 12 of version 1.


Only the errors come from the 12 strategies in version 2. When I test with version 1 I have no bug ... On the forum when I gave the code to one of your collaborator he told me to also have them errors.

AD
#10

Siuko

20.05.2021 15:42
What should I do in this case? which metatrader do you have? I am using the one from ICMarket.
AD
#11

Siuko

28.05.2021 08:24
Any solution ?
AD
#12

Siuko

28.05.2021 08:36

Still no solution? I sold an EA which has this message in the expert tab, result I have buyers from the community mql5 who are complaining ...


Please find a solution quickly ...

TB
#13

Tomas Brynda

03.06.2021 08:20
My colleague also experiences this problem. But I am unable to simulate it.

Even if I use the same EA and try to run on custom or live symbol with various date ranges, the error never occurs.

We will investigate this issue further, but it looks like it's some kind of problem of MetaTrader itself.


I personally use Alpari, but I'm not sure if it is a broker-related problem.

AD
#14

Siuko

03.06.2021 11:45
Ok, I fear the worst ... That the fact of Merge the strategies just doesn't work
TB
#15

Tomas Brynda

03.06.2021 12:32
The problem has occured even during backtest of a single strategy. 

It has nothing to do with portfolios.

AD
#16

Siuko

03.06.2021 13:14

Yes it's true, I also have differences between backtest and live use.


The backtest does not come up with an error 4806, but in actual use I have the error 4806.


What I don't understand is that it's never been seen before? it's new ?

TB
#17

Tomas Brynda

03.06.2021 14:25
It's really strange, we get 4806 even during backtest on one MT instance.

This kind of error is a new thing, it didn't happen until recently.

AD
#18

Siuko

03.06.2021 14:51

Yes really strange because all the backtests that I do and the tests on a real VPS server show me real errors that do not take place in backtest. However, sometimes I have the error in backtest, but I did not test in real life if the error is also present.


I didn't try with MT4 if it's also the same problem.


I am a C #, C ++, VB.net python ect professional developer .... I have no trouble reading the generated code but the error seems random. Difficult to repeat.

TB
#19

Tomas Brynda

03.06.2021 15:07
Yes those kinds of errors are the worst.

We have tried a lot of things, but nothing helped. The problem happens also when getting data from MT built-in indicators, so it seems like it's not a problem in our custom indicators code.

We are still trying to identify the problem. If you make some progress, please let us know.

AD
#20

Siuko

03.06.2021 15:21

I do not know if I will help but I had an idea, a lead can be.

Since the error this occurs with the CopyBuffer () founction and that according to my experience happened with this error.


Notably the fact that the strategy which returned the error to work well the previous version and that after that does not work any more just because I enriched the number of strategies.


That the language approaches C see C ++, I wonder if it is not a problem on the memory. I don't know what exactly but that's what I'm wondering.


I would love to have the code for the CopyBuffer function and the sub-functions.

AD
#21

Siuko

03.06.2021 15:23

I ask the question on the MQL5 forum a moderator replied with a "boat" solution, he doesn't know any more I have the impression ...


Here is the link: https://www.mql5.com/en/forum/369669

b
#22

beppil

25.06.2021 22:43
Voted for this task.
o
#23

Enric

10.08.2021 17:28
Voted for this task.
TT
#24

Tamas

07.09.2022 14:07

Status changed from In progress to Fixed

It looks that the problem is in MT platform itself. No solution yet...closing the task 


https://www.mql5.com/en/forum/369669


Votes: +2

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please