At first tests, when I test the EA on TF = DL the EA closed the positions with very long losses or profits. Then I saw that the SL or TP was only activated when new bar opened and the results were not correct. I have tried to change the model to “Tick mode” but it take 20min to analyse each bar!
- It is correct to set the SL and TP only after the OrderSend being sended and accepted?
I have tried to search on the forum and on the book for these bugs can I can't understand somethings. I know that most of you can makethe same EA with less code! :)
Thanks for your help.
Here is an article about optimisation :
Method of modeling control points is intended for crude estimate of Expert Advisors
trading within a bar. To use this method, historical data of the nearest less timeframe
must be available. In the some cases, the data available from a smaller timeframe
do not completely cover the time span of the timeframe under test. If there are
no data of a smaller timeframe, the bar evolution is generated on basis of predefined
wave templates, as it was the case in the preceding third version of MetaTrader
3 Client Terminal.
As soon as historical data of the less timeframe appear, these are these data that
are interpolated. However, the really existing OHLC prices of the less timeframe
appear as control points. In the most cases, the results of tests of Expert Advisors
by method of control points can be considered as estimated results only, not as final ones. Such results are of intermediate, estimated nature. The chart
below shows how the on-hour bar of 2007.09.05 10:00 developed by method of control
this article also : https://www.mql5.com/en/articles/1385
In conclusion, let's consider some of the most frequently asked questions that new users usually have when testing EAs.
1. What causes difference in results of the same tests at different Dealing Centers?
The difference in test results at different Dealing Centers is caused
by quote differences. Each broker has its own sources of quote feeds.
This gives rise to differences in price, which is then reflected in test
2. Why do the same tests run at the same Dealing Center produce different results?
Different results obtained at the same Dealing Center may be caused by several reasons, the most common one being:
Floating spread - it has a quite strong impact on the results,
especially when testing on lower time frames and using the EVERY TICK
mode. The MetaTrader 4 Strategy Tester stores the last spread value. The
spread might change in the next run and the test result will
consequently be different.
The difference in test results at different Dealing Centers is causedby quote differences. Each broker has its own sources of quote feeds.This gives rise to differences in price, which is then reflected in testresults.
Floating spread - it has a quite strong impact on the results,especially when testing on lower time frames and using the EVERY TICKmode. The MetaTrader 4 Strategy Tester stores the last spread value. Thespread might change in the next run and the test result willconsequently be different.
Thanks for your explanation and your links.
Normally I don´t use the www.mql5.com because I was thinking that it was only for MQL5... although there's lots of FAQs and articles for MQL4!
Can you help on this questions?
- It is correct to set the SL and TP only after the OrderSend being sended and accepted? Its a good practice?
Thanks for your help. Best regards.
Read the book and the documentation :
Converting a numeric value to a text line with a specified accuracy
I didn't notice on one note that says when using the Print(), the output to Journal may contain a greater number of decimal places than expected! And in my case only happened sometimes and in the log file...
Thanks. Best regards
To add comments, please log in or register