Errors, bugs, questions - page 2174

 

The profit currency (SYMBOL_CURRENCY_PROFIT) of the custom symbol is reset after Terminal restart. Because of this, the TickValue is often zero, which generates trades with zero profit in the Strategy Tester. Each time, we have to return the value of profit currency to a normal one.


Playback

void OnStart()
{
  const string Name = "EXAMPL";
  
  if (CustomSymbolCreate(Name))
    CustomSymbolSetString(Name, SYMBOL_CURRENCY_PROFIT, "JPY");

  Print(SymbolInfoString(Name, SYMBOL_CURRENCY_PROFIT)); // "JPY" - до перезагрузки Терминала, "MPL" - после.
}
 
On custom symbols in the Tester you get graals due to positive slippage of limit orders. Please disable limit order slippage for custom symbols, or adjust slippage (and commission).
 

No option to disable Core1-Agent.

No way to run a single run

2018.03.27 09:18:19.647 Core 1  agent process started
2018.03.27 09:18:28.380 Core 1  connecting to 127.0.0.1:3000
2018.03.27 09:18:45.562 Core 1  tester agent authorization error
2018.03.27 09:18:45.564 Core 1  connection closed

Restarting Terminal doesn't help.


HH This is how the Optimization happens from just two passes(animation)

There are continuous authorization errors on the Agents until normal connections occur. And that's only on two passes!

 

There is a severe lack of a list of available symbols to choose from.

 
fxsaber:

There is no option to disable Core1-Agent.


Would also like to disable the first core.
 

In addition to this

Forum on trading, automated trading systems and trading strategies testing

Bugs, bugs, questions

Kirill Belousov, 2018.03.26 12:30

The names are different and the deletion is done with that in mind.


SAVE THAT:

_______________________________________

When deleting the first indicator in the subwindow list, the subwindow is completely cleared of objects (even manually drawn lines, arrows, text labels are deleted)

Reproduced:

1. Create in the constructor an empty indicator for a separate window (or take any existing indicator, for example MACD, etc. from the standard delivery set)

2. Add 5 indicators/copies to one subwindow

3. Manually draw a vertical line in a subwindow (or any object).

If you remove any indicator not the first from the indicator list, the line will remain, but if the first one is in the list, all subwindow objects will be deleted (drawn vertical line).

If you draw a line again after deleting the first one, it will be deleted again when the first of the remaining ones is deleted. When not the first one is deleted, the objects in the subwindow are not deleted.


Where it is written about it in documentation? What makes it so special - the first indicator in the subwindow list?

It looks like there is a complete reinitialisation of the subwindow.


Reproduced by MT4/MT5.

The difference is that in MT5 the indicator files' names should be different. In MT4, you can put the same indicator file in one subwindow without changing the file name.


Problem with the first subwindow indicator

All objects are deleted in a subwindow, if the indicator was the first in the list of indicators of a subwindow at the moment of its deletion

When deleting the first indicator from the list of indicators in a subwindow, all subwindow objects are removed BEFORE OnDeinit()

void OnDeinit(const int reason)
  {
  int window=ChartWindowFind();
  if(window==2)
  {
  int count=0;
  for(int i=ObjectsTotal()-1;i>=0;i--)
    {
     if(ObjectFind(ObjectName(i))==window) count++;
    }
  Alert("Осталось объектов в подокне #2 - ",count," _StopFlag=",_StopFlag," REASON=",reason);
  }
//....
}

Let's delete not the first one but the first one in the list

All objects are deleted

All objects are deleted, regardless of whether they are indicators or manually created objects in a subwindow.
 

Running the advisor in "All ticks" mode on MQ-Demo

void OnTick()
{
  static int i = 0;
  
  if (i < 2)
  {
    MqlTick Tick;
    
    if (SymbolInfoTick(_Symbol, Tick))
      Print(Tick.time_msc);
      
    i++;
  }
  else
    ExpertRemove();
}


Result

Si-6.18,M1 (MetaQuotes-Demo): every tick generating
Si-6.18,M1: testing of Experts\fxsaber\LimitsSlippage.ex5 from 2018.03.25 00:00 to 2018.03.27 00:00 started
2018.03.26 10:00:00   1522058400378
2018.03.26 10:00:00   1522058400013
2018.03.26 10:00:00   ExpertRemove() function called

The time of the first generated tick is longer than the second - bug.

 
The optimizer goes into infinite loop with the following (all three passes have been started) repeating messages
2018.03.27 23:13:54.520 Core 2  TESTER_EURUSD: history for 2017 year synchronized
2018.03.27 23:13:54.578 Core 1  pass 0 tested with error "history processing error (314 TESTER_EURUSD)" in 0:00:00.125
2018.03.27 23:13:54.580 Core 2  pass 1 tested with error "history processing error (314 TESTER_EURUSD)" in 0:00:00.124
2018.03.27 23:13:54.580 Core 3  pass 2 tested with error "history processing error (314 TESTER_EURUSD)" in 0:00:00.124
2018.03.27 23:13:54.600 Core 5  common synchronization completed


ZS Playback


Copy the contents of the attached archive to the sandbox.

Run script on MQ-Demo

#include <fxsaber\ThirdPartyTicks\ThirdPartyTicks.mqh> // https://www.mql5.com/ru/code/20225

void OnStart()
{
  THIRDPARTYTICKS ThirdPartyTicks; // Подключились к локальному архиву котировок

  const string Name = ThirdPartyTicks["EURGBP"].ToCustomSymbol(true); // Создали кастомный символ на основе локального архива  
  
  if (Name != NULL)
  {
    const SYMBOL Symb("TESTER"); // Создали символ
  
    if (Symb.IsExist()) // Если символ создан
    {
      Symb.CloneProperties("Si-6.18");      
      Symb.SetProperty(SYMBOL_DIGITS, 5);
      
      Symb.CloneHistory(Name);
  
      if (Symb.On()) // Включили в Обзор рынка
        ChartOpen(Symb.Name, PERIOD_CURRENT); // Открыли график нового символа
    }   
  }
}


A custom TESTER symbol will be created. Select it in the Tester. Setting: Optimization slow, All ticks.

Add this EA

input int Range = 0;

void OnTick() {}


Options tab


Start Optimization and watch this infinite loop


Files:
Archive.zip  1729 kb
 

In the Tester, remote orders on "no money" are assigned zero closing time

This is a bug, of course.

 

Am I the only one with an image from this post that doesn't open in a new popup? Mozilla FireFox 59.0.2 (64bit)

I.e., the image that is in the quote does not open.

Reason: