MetaTrader 5 Strategy Tester: bugs, bugs, suggestions for improvement - page 59

 
Sergey Chalyshev:

The parameters in the optimisation result line are correct, they match the parameters in the tester's log, but the Expert Advisor is run for a test with completely different parameters.

I unset the input parameters from the Expert Advisor itself. They matched.

 
fxsaber:

It's just that the data of the original symbol matches the custom one perfectly. But the custom one passes without errors, and the original one does not.

Apparently, I didn't get the point. The script only writes the csv. How does it run a test on them?

 
Andrey Khatimlianskii:

Apparently, I didn't get the point. The script only writes csvs. How is the test run on them?

The script creates a custom symbol and the original symbol (imported on the server side) from these csvs.

I.e. the two symbols have identical quote history, both by bars and by ticks.

 
fxsaber:

The script creates a custom symbol and the original symbol(imported on the server side) from these csvs.

I.e. the two symbols have identical quote history, both in bars and in ticks.

This should have been mentioned.

I don't know the mechanisms of MT5 server to work with history.

 
Advisor in frame mode finished on Abnormal Termination, after which the 1GB mqd file refused to be read. When I closed the Terminal, the mqd grew to 2GB. I.e. Terminal did not do FileClose for mqd.
 

During genetics, the pass number from FrameNext does not match the pass number from the opt file.

For example, FrameNext returns 10041014291 and opt returns 2465.

What's the reason for the differences? How do I match one to the other?

In GUI table instead of pass number some two numbers. But as soon as I re-open the opt file after Optimization, the pass numbers become empty values.


Please clarify for GA.


Learned how to reproduce GA and single mismatch. Saved GA passes through frames stats. But I can't identify out of 10K passes the one I'm interested in. Because Pass in FrameNext and Pass in opt are different values.

 
fxsaber:

During genetics, the pass number from FrameNext does not match the pass number from the opt file.

For example, FrameNext returns 10041014291 and opt returns 2465.

What's the reason for the differences? How do I match one to the other?

In GUI table instead of pass number some two numbers. But as soon as I re-open the opt file after Optimisation, the pass numbers become empty values.


Please clarify for GA.


Learned how to reproduce GA vs. single GA mismatch. Saved GA passes through frames stats. But can't identify out of 10K passes the one I'm interested in. Because Pass in FrameNext and Pass in opt are different values.

2 numbers - generation number, individual number.

If empty, then result is loaded from opt file (i.e. result from previous genetic optimization)

There are two types of genetics

1. Parameter space is limited to 64-bit number. In this case parameter composition calculation by genotype number is reduced to a set of simple arithmetic operations.

2. parameter space is limited by maximal 64-bit number from below, 1024-bit number from above. A more complex transformation of the genotype into a set of parameters. Seems to be your case of number mismatch, since frames contain only the 64 lowermost bits of the pass number.

As soon as a new parameter is added to the optimisation or the start-stop of an existing parameter is changed, the entire numbering changes. Therefore, do not go by the pass number, but by the composition of the parameters

Документация по MQL5: Основы языка / Операции и выражения / Арифметические операции
Документация по MQL5: Основы языка / Операции и выражения / Арифметические операции
  • www.mql5.com
Операция инкремента и декремента применяются только к переменным, к константам не применяются. Префиксныe инкремент (++i) и декремент (--k) применяются к переменной непосредственно перед использованием этой переменной в выражении. Могут возникнуть вычислительные проблемы при переносе вышеуказанного выражения из одной среды программирования в...
 
Slava:

2 numbers - generation number, individual number.

If empty, the result is loaded from the opt file (i.e. the result from the previous genetic optimization)

There are two types of genetics

1. Parameter space is limited to 64-bit number. In this case parameter composition calculation by genotype number is reduced to a set of simple arithmetic operations.

2. parameter space is limited by maximal 64-bit number from below, 1024-bit number from above. A more complex transformation of the genotype into a set of parameters. Seems to be your case of number mismatch, as frames only contain a maximum 64-bit pass number.

As soon as a new parameter is added to the optimization or the start-stop of an existing parameter is changed, the whole numbering changes. So don't go by the pass number, just by the composition of the parameters

Thanks. How do you match FrameNext_Pass and opt-Pass then?

 
fxsaber:

Learned to reproduce the mismatch between GA and single. Saved the GA passes through the frames stats. But I can't identify the one I'm interested in out of 10K passes. Because Pass in FrameNext and Pass in opt are different values.

Found the reason for the discrepancy!


Compared the stack obtained through the frame during GA optimization. And the stack of a single pass.


In the frame-state the execution is based on ticks which are not present in the history: I noticed at once that there are a lot of deals/orders, which are executed in exactly one second.

For example, a single pass in history has an entry at 2019.06.04 02:00:00.206, but a frame pass is 2019.06.04 02:00:00.000(tick history has no tick at that time).


GA optimisation goes on a different tick history from the single pass! And this history is not always different. For example, when I do GA on a smaller interval, it's fine there.


ZZY suspicion of using a timer falls away. There is no timer in the EA.

 
fxsaber:

Found the reason for the discrepancy!


Compared the frame-by-frame stats during GA optimisation. And the stack of a single pass.


In the frame-state the execution is based on ticks, which are not in the history: I immediately noticed that there are a lot of deals/orders, which are executed in exactly one second.

For example, a single pass in history has an entry at 2019.06.04 02:00:00.206, but a frame pass is 2019.06.04 02:00:00.000(tick history has no tick at that time).


GA optimisation goes on a different tick history from the single pass! And this history is not always different. For example, when I do GA on a smaller interval, it's fine there.


ZZY suspicion of using a timer falls away. There is no timer in the EA.

Testing/optimisation on real ticks?

Are the agents your own or from the cloud?

If testing on a custom symbol, then cloud agents are off the table. So the agents are in-house and you can pull their logs and see in the logs how the history was synced