Features of the mql5 language, subtleties and tricks - page 319

 

A way to get an unnamed symbol window.



  1. Close all charts and clear the Market Watch of symbols.
  2. In mat mode, run the EA optimisation below.

input int inRange = 0;

int OnTesterInit() { return(INIT_FAILED); }
void OnTesterDeinit() {}
double OnTester() { return(0); }


This window will appear. It is probably of no practical use, as you cannot run anything further on it.


But the frame mode itself works properly on it and it is correct.

2025.11.11 16:28:06.025 EAToMath_Example (XAUUSD.pro,M1)        [2025.11.11 16:28:06.025] EAToMath.mqh 1114: XAUUSD.pro: math optimization of Experts\fxsaber\EAToMath_Example.ex5 from 2025.10.03 00:00:00 to 2025.11.04 00:00:00, 1 Month 1 Day
2025.11.11 16:28:06.025 EAToMath_Example (XAUUSD.pro,M1)        
2025.11.11 16:28:06.025 EAToMath_Example (XAUUSD.pro,M1)        FileOpen mode: C:\Users\Unknown\AppData\Roaming\MetaQuotes\Terminal\Common\EAToMath.mqh\RannForex-Server\XAUUSD.pro\Ticks_0.tsh
2025.11.11 16:28:06.025 EAToMath_Example (XAUUSD.pro,M1)        StartTime = 2025.11.11 16:28:06
2025.11.11 16:28:49.696 EAToMath_Example (XAUUSD.pro,M1)        ExpertRemove() function called
2025.11.11 16:29:13.041 EAToMath_Example        [2025.11.11 16:29:13.040] EAToMath.mqh 1114: XAUUSD.pro: math optimization of Experts\fxsaber\EAToMath_Example.ex5 from 2025.10.03 00:00:00 to 2025.11.04 00:00:00, 1 Month 1 Day
2025.11.11 16:29:13.041 EAToMath_Example        
2025.11.11 16:29:13.041 EAToMath_Example        FileOpen mode: C:\Users\Unknown\AppData\Roaming\MetaQuotes\Terminal\Common\EAToMath.mqh\RannForex-Server\XAUUSD.pro\Ticks_0.tsh
2025.11.11 16:29:13.041 EAToMath_Example        StartTime = 2025.11.11 16:29:13
2025.11.11 16:30:20.324 EAToMath_Example        ExpertRemove() function called

This log shows the launch of the matrix frame-mode when there is a symbol (marked) in the Market Watch and when there is not. You can clearly see that the Terminal shows only the name of the Expert Advisor - without the symbol. And the Expert Advisor is fully executed.


This is probably the most appropriate thread to describe this case.

 
fxsaber #:

...

This window will appear. It is probably of no practical use, as you cannot run anything further on it.

...

It hangs while waiting for initialisation to finish?

How in this case? 👇

 

Anatoli Kazharski #:
Он зависает в режиме ожидания окончания инициализации?

It does not hang, but fully executes the frame code of the Expert Advisor.

How in this case? 👇

In this case, a chart is opened whose historical data is not in the database (among real and custom symbols). But its behaviour is identical, it just has a symbol name.

 
fxsaber #:

It does not hang, but fully executes the EA frame code.

In this case, a chart is opened whose historical data is not in the database (among real and custom symbols). But its behaviour is identical, it just has a symbol name.

Is it impossible to create graphical objects on it? That is, will they be visible when the chart is in this state?
 
Anatoli Kazharski #:
Can't graphical objects be created on it? That is, will they be visible when the chart is in this state?
It is possible to do anything on this chart only in frame mode. Even "create" an object, but it will not be visible.
input int inRange = 0;

int OnTesterInit()
{
  const string Name = __FILE__;
  
  Print(ObjectCreate(0, Name, OBJ_VLINE, 0, 0, 0)); // true - it worked.
  Print(ObjectFind(0, Name));                       // -1 - but is not found.
  
  return(INIT_FAILED);
}

void OnTesterDeinit() {}
double OnTester() { return(0); }
 
fxsaber #:
It is possible to do anything on this chart only in frame mode. Even "create" an object, but it won't be visible.
It's a pity. It means that at the moment there is no possibility to visualise processes in the matrix frame-mode in the terminal.
 
Anatoli Kazharski #:
It means that at the moment there is no possibility to visualise processes taking place in the matrix frame-mode in the terminal.

Forum on trading, automated trading systems and testing trading strategies

Peculiarities of mql5 language, subtleties and techniques of work

fxsaber, 2025.11.11 14:50

2025.11.11 16:28:06.025 EAToMath_Example (XAUUSD.pro,M1)        [2025.11.11 16:28:06.025] EAToMath.mqh 1114: XAUUSD.pro: math optimization of Experts\fxsaber\EAToMath_Example.ex5 from 2025.10.03 00:00:00 to 2025.11.04 00:00:00, 1 Month 1 Day
2025.11.11 16:28:06.025 EAToMath_Example (XAUUSD.pro,M1)        
2025.11.11 16:28:06.025 EAToMath_Example (XAUUSD.pro,M1)        FileOpen mode: C:\Users\Unknown\AppData\Roaming\MetaQuotes\Terminal\Common\EAToMath.mqh\RannForex-Server\XAUUSD.pro\Ticks_0.tsh
2025.11.11 16:28:06.025 EAToMath_Example (XAUUSD.pro,M1)        StartTime = 2025.11.11 16:28:06
2025.11.11 16:28:49.696 EAToMath_Example (XAUUSD.pro,M1)        ExpertRemove() function called
2025.11.11 16:29:13.041 EAToMath_Example        [2025.11.11 16:29:13.040] EAToMath.mqh 1114: XAUUSD.pro: math optimization of Experts\fxsaber\EAToMath_Example.ex5 from 2025.10.03 00:00:00 to 2025.11.04 00:00:00, 1 Month 1 Day
2025.11.11 16:29:13.041 EAToMath_Example        
2025.11.11 16:29:13.041 EAToMath_Example        FileOpen mode: C:\Users\Unknown\AppData\Roaming\MetaQuotes\Terminal\Common\EAToMath.mqh\RannForex-Server\XAUUSD.pro\Ticks_0.tsh
2025.11.11 16:29:13.041 EAToMath_Example        StartTime = 2025.11.11 16:29:13
2025.11.11 16:30:20.324 EAToMath_Example        ExpertRemove() function called

In this log, the start of mat. frame-mode, when in the Market Watch there is a symbol (marked), and when - not.

It is enough to have one symbol with at least some bar history in the Market Watch. This will be enough to have a full-fledged visualisation in the matrix frame mode.
 
fxsaber #:
It is enough to have one symbol with at least some bar history in the Market Watch. It will be enough to have a full-fledged visualisation in the matrix frame mode.
Got it. It's already more interesting!
I hope I will be able to test all this in detail soon. I will report the results.
 

How to make it work

//+------------------------------------------------------------------+
//|Internal.mq5 |
//+------------------------------------------------------------------+
int OnInit() { Print("Init Internal"); return(INIT_SUCCEEDED);}

void OnDeinit(const int reason) {Print("Deinit Internal");}

void OnTick() {Comment(TimeCurrent());}



//+------------------------------------------------------------------+
//|External.mq5 |
//+------------------------------------------------------------------+
#import "Internal.ex5"
namespace EA{
int OnInit(void);
void OnDeinit(const int);
void OnTick(void);
}
#import

int OnInit() {EA::OnInit(); Print("Init External"); return(INIT_SUCCEEDED);}

void OnDeinit(const int reason) {EA::OnDeinit(reason); Print("Deinit External");}

void OnTick() {EA::OnTick();}
 
Rorschach #:

How to make it work

Try it like this:

//+------------------------------------------------------------------+
//|Internal.mq5 |
//+------------------------------------------------------------------+
int OnInit() export { Print("Init Internal"); return(INIT_SUCCEEDED);}

void OnDeinit(const int reason) export {Print("Deinit Internal");}

void OnTick() export {Comment(TimeCurrent());}
Result:
2025.11.12 13:35:32.996 Init Internal
2025.11.12 13:35:32.996 Init External
2025.11.12 13:38:31.308 Deinit Internal
2025.11.12 13:38:31.308 Deinit External