Analysis of test results and optimisation in the MetaTrader 5 strategy tester - page 14

 
Ilya Malev #:
The task was to make the tester take into account, when checking the execution of orders on a given bar, high and low-ask in the testing mode Only bar opening (for example, H1).

You can play with MqlRates.spread to achieve High/Low-ask. I don't know how this field affects the generation of asks now.

The task is really to find the golden mean between accuracy and speed. It might make sense to thin the ticks a lot and use the corresponding custom symbol in the real ticks mode.

 
fxsaber #:

The challenge is actually to find the golden mean between accuracy and speed. Perhaps it makes sense to thin the ticks a lot and use the corresponding custom symbol in the real ticks mode.

You can try it that way.

#property script_show_inputs

input string inName = "";
input datetime inFrom = D'2025.01.01';
input datetime inTo = D'2026.01.01';
input ENUM_TIMEFRAMES inPeriod = PERIOD_CURRENT;
input int inMinPips = 0;

#include <fxsaber\TicksShort\LotsTicks.mqh> // https://www.mql5.com/en/code/61126

void OnStart()
{
  LOTS_TICKS LotsTicks;
  
  if ((LotsTicks.CopyTicksRange(_Symbol, COPY_TICKS_ALL, inFrom * 1000, inTo * 1000) > 0) &&   
      (LotsTicks.Filter(inMinPips, PeriodSeconds(inPeriod)) > 0))
  {
    const string Name = (inName == "") ? "FILTER" + (string)inMinPips + "_" + _Symbol : inName;
    
    if (CustomSymbolCreate(Name, NULL, _Symbol) &&
        (LotsTicks.CustomTicksReplace(Name) > 0) &&
        SymbolSelect(Name, true))
      ChartOpen(Name, _Period);
  }
}
 
fxsaber #:

You could try it that way.

The problem is that if we use wildcard ticks instead of just the opening prices, making the Real ticks mode, the orders will be executed not at the price of their placing (as in the Just opening prices mode), but at the prices of the first ticks after their crossing, which will be absolutely inadequate execution if there are only a few ticks per hour. On this basis:

fxsaber #:
Yes.
 
Ilya Malev #:

The problem is that if we use wildcard ticks instead of just the opening prices, making the Real ticks mode, the orders will be executed not at the price of their placing (as in the Just opening prices mode), but at the prices of the first ticks after their crossing, which will be absolutely inadequate execution if there are only a few ticks per hour. Proceeding from this:

Execution with slippage is the norm.
 
fxsaber #:
Executing with slippage is the norm.
A few pips is the norm, not half a bar.
 
And in the case of take-outs and limits, assuming that they are sliding in the plus range, it will be an unprecedented ride of generosity. Considering that they rarely slip in practice at all
 
Ilya Malev #:
they rarely slip in practice at all.
I've had the opposite experience.