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

 
traveller00:
Yes, I copied from the parameters and saw what form it expects to see. But it is not very convenient to handle such values. That's why I asked if it's possible to introduce date formats support there, like in source.

Is the person editing set files?


If datetime-intputs are displayed (set-files, CTRL+C tester, tpl-files and probably something else) as a string instead of a number, the whole convenience of parsing this data will collapse.

Now there are only three kinds of input data: double, long and string. The first two are always numbers. This one includes not only datetime, but also color, enum and everything except string. This is super convenient!


Creating one more entity, thus making a lot of code unusable, is not very sensible. There are comments. Here is an example of an automatically generated set.

Forum on trading, automated trading systems and strategy testing

Libraries: TesterCache

fxsaber, 2019.11.11 04:45

; saved on 2019.11.13 19:40:01
; Experts\Examples\MACD\MACD Sample LImitTP.ex5
; EURUSD
; 2019.09.01 - 2019.11.13
; 479, 10, Max, 47.92, -253.60
;
InpLots=0.1
InpTakeProfit=200||10||5||500||Y
InpTrailingStop=290||30||10||300||Y
InpMACDOpenLevel=5||5||5||200||Y
InpMACDCloseLevel=180||5||5||200||Y
InpMATrendPeriod=8||1||1||200||Y
;
; Pass = 1838
; initial_deposit = 10000.0
; withdrawal = 0.0
; profit = 479.15
; grossprofit = 479.15
; grossloss = 0.0
; maxprofit = 99.8
; minprofit = 0.0
; conprofitmax = 479.15
; maxconprofit = 479.15
; conlossmax = 0.0
; maxconloss = 0.0
; balance_min = 10000.0
; maxdrawdown = 0.0
; drawdownpercent = 0.0
; reldrawdown = 0.0
; reldrawdownpercent = 0.0
; equity_min = 9997.700000000001
; maxdrawdown_e = 253.6000000000004
; drawdownpercent_e = 2.457388152985982
; reldrawdown_e = 253.6000000000004
; reldrawdownpercnt_e = 2.457388152985982
; expected_payoff = 47.91500000000001
; profit_factor = 1.797693134862316 e+308
; recovery_factor = 1.889392744479493
; sharpe_ratio = 1.069726339729858
; margin_level = 1.797693134862316 e+308
; custom_fitness = 0.0
; deals = 15
; trades = 10
; profittrades = 10
; losstrades = 0
; shorttrades = 6
; longtrades = 4
; winshorttrades = 6
; winlongtrades = 4
; conprofitmax_trades = 10
; maxconprofit_trades = 10
; conlossmax_trades = 0
; maxconloss_trades = 0
; avgconwinners = 10
; avgconloosers = 0
; 
; version = 515
; copyright = Copyright 2000-2019, MetaQuotes Software Corp.
; name = TesterOptCache
; header_size = 2526
; record_size = 328
; expert_name = MACD Sample LImitTP
; expert_path = Experts\Examples\MACD\MACD Sample LImitTP.ex5
; server = MetaQuotes-Beta
; symbol = EURUSD
; (ENUM_TIMEFRAMES)period = PERIOD_M1
; date_from = 2019.09.01 00:00:00
; date_to = 2019.11.13 00:00:00
; date_forward = 1970.01.01 00:00:00
; opt_mode = 1
; ticks_mode = 4
; last_criterion = 0
; msc_min = 501
; msc_max = 2342
; msc_avg = 801
; group = demo (netting)
; trade_currency = USD
; trade_deposit = 10000
; trade_condition = 0
; trade_leverage = 100
; trade_hedging = 1
; trade_currency_digits = 2
; trade_pips = 0
; parameters_size = 28
; parameters_total = 6
; opt_params_size = 40
; opt_params_total = 5
; dwords_cnt = 0
; snapshot_size = 0
; passes_total = 0
; passes_passed = 2510

I don't know about others, but I find it convenient when the set file contains all the information. It's very quick to figure out what it is, where it comes from and how much.


Isn't that enough?


ZZY One should remember that datetime and optimized, you can set Start, Step, Stop. Where Step, of course, even in GUI is set in seconds.

 
I meant copying to buffer by CTRL+C to leave the number as it was. But paste by CTRL+V should be extended to understand both old format (essentially ulong) and new string format. This shouldn't break anything, but it will expand it for those who want to specify a string instead of a number.
 
traveller00:
I meant copying to the buffer by CTRL+C to leave the number as it was. But to extend paste by CTRL+V to understand both the old format (essentially ulong) and the new string format. This shouldn't break anything, but it will expand it for those who want to specify a string instead of a number.

Good clarification. It really won't break anything. Really, I don't know people who use CTRL+V to set the date.

 
fxsaber:

However, I don't know people who use CTRL+V to set the date.

It's more a question of setting not the date, but the parameters in general, including where the date is. Firstly, to make it consistent, since mql itself keeps the date format, and secondly, to make it clear, not to multiply comments. For my testing, it generates the input parameters, which should be evaluated by eye, and then I can add them.

Slava:
Maybe. We will.

Can we at the same time support insertion (via CTRL+V) of input parameters for Expert Advisor? For testing, it is inserted in Parameters perfectly. However, when it is not testing but simply adding an EA to a chart, the Input Parameters tab does not seem to support pasting and I have to fill in the same parameters manually. Thank you.

 
traveller00:

Can we also support insertion (via CTRL+V) of Input parameters for the EA? It is inserted perfectly for testing in Parameters. However, when it is not testing but simply adding an EA to a chart, the Input Parameters tab does not seem to support pasting and I have to fill in the same parameters manually. Thank you.

AND CTRL+C.

 

Developers, hello!

For some reason, this check in OnTimer does not always work in the strategy tester when running the EA (I don't know what it has to do with it):

    if (MQLInfoInteger(MQL_PROFILER) == 0 && MQLInfoInteger(MQL_TESTER) == 0) {
        Print("You can't use this version of EA in trade mode!");
        return;
    }

OnInit always seems to work fine.

PS. At the same time, the trade does not always work. I'll add logs for test modes as to why trading is not allowed. Floating glitch of some kind.
Тестирование стратегий - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
Тестирование стратегий - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
  • www.metatrader5.com
Тестер стратегий позволяет тестировать и оптимизировать торговые стратегии (советники) перед началом использования их в реальной торговле. При тестировании советника происходит его однократная прогонка с начальными параметрами на исторических данных. При оптимизации торговая стратегия прогоняется несколько раз с различным набором параметров...
 

I faced with the fact that graphical objects in MT5 tester in visualization mode are not drawn the way I thought they would be. I have simplified the test Expert Advisor to the limit, it should build a rectangle by coordinates taken on the basis of 50th and 45th bars. The code is in the attachment, but all the logic is in one line:

if (!IsNewBar()) return;
RectangleCreate(0, "5BarZone", 0, iTime(NULL,0,50), iHigh(NULL,0,50), iTime(NULL,0,0), iLow(NULL,0,45), clrGreen, STYLE_SOLID, 1, true, true);
ChartRedraw(0);

The EA should redraw such a channel on every new bar of the current TF. The picture should look like this:


In reality, the rectangle stretches chaotically both in length and width and the picture looks like this:


The code of the working EA contains many more objects and each of them is distorted even more, resulting in a mess.

Moreover, if we run a visual testing of the test EA at a low speed, the rendering is almost always correct. When I runa test Expert Advisor at maximum speed or at a nearly maximum speed, or run a real EA with a lot of objects even at minimum speed, I get the above described distortions.

Please advise what the problem is and whether it can be solved. Tried to search for an answer but failed.

Much appreciated any help in any way.

Files:
 
Andrey Pogoreltsev:

Developers, hello!

For some reason, the OnTimer check does not always work in the strategy tester when running the EA (I don't know what it has to do with it):

OnInit always seems to work fine.

PS. At the same time, the trade does not always work. I'll add logs for test modes why trading is not allowed. Floating glitch of some sort.
Replace && with ||.
 
Grigori.S.B:

I have faced with the fact that graphical objects in MT5 tester in visualization mode are not rendered as I expected. I have simplified the test Expert Advisor to the limit, it should build a rectangle by coordinates taken on the basis of 50th and 45th bars. The code is in the attachment, but all the logic is in one line:

The EA should redraw such a channel on every new bar of the current TF. The picture should look like this:


In reality, the rectangle stretches chaotically both in length and width and the picture looks like this:


The code of the working EA contains many more objects and each of them is distorted even more, resulting in a mess.

Moreover, if we run a visual testing of the test EA at a low speed, the rendering is almost always correct. However, when I runa test Expert Advisor at maximum speed or at nearly maximum speed, or run a real EA with a lot of objects even at minimum speed, I get the above described distortions.

Please advise what the problem is and whether it can be solved. Tried to search for an answer but failed.

Much appreciated any help in any way.

Try simply changing the coordinates of a once-created object
 
Grigori.S.B:

I have faced with the fact that graphical objects in MT5 tester in visualization mode are not rendered as I expected. I have simplified the test Expert Advisor to the limit, it should build a rectangle by coordinates taken on the basis of 50th and 45th bars. The code is in the attachment, but all the logic is in one line:

The EA should redraw such a channel on every new bar of the current TF. The picture should look like this:


In reality, the rectangle stretches chaotically both in length and width and the picture looks like this:


The code of the working EA contains many more objects and each of them is distorted even more, resulting in a mess.

Moreover, if we run a visual testing of the test EA at a low speed, the rendering is almost always correct. When I run a test Expert Advisor at maximum speed or at a nearly maximum speed, or run a real EA with a lot of objects even at minimum speed, I get the above described distortions.

Please advise what the problem is and whether it can be solved. Tried to search for an answer but failed.

Much appreciated any help in any way.

Check code for errors, most likelyERR_OBJECT_ALREADY_EXISTS.

You either have to delete the object before recreating it or

Slava:
Try simply changing the coordinates of an object once created