ChartClose + SymbolSelect /false + CustomSymbolDelete in OnDeinit or object destructor

 

Is this possible?

ChartClose is asynchronous, Sleep doesn't work, too long loop also fails most of the time.

I know I can write an extra function, but is it possible to somehow make it work in the destructor (which is usually executed in OnDeinit)?

 

Before ChartClose use ChartSetSymbolPeriod+ChartRedraw.

Documentation on MQL5: Chart Operations / ChartSetSymbolPeriod
Documentation on MQL5: Chart Operations / ChartSetSymbolPeriod
  • www.mql5.com
Changes the symbol and period of the specified chart. The function is asynchronous, i.e. it sends the command and does not wait for its execution completion. The command is added to chart messages queue and will be executed after processing of all previous commands. The call of ChartSetSymbolPeriod with the same symbol...
 

That's just brilliant. Thank you, sir!



void КСекундичка::ЗатварянеВсичкотоГрафика()
  {
   int всичкото_графика = ArraySize(ч_графикчките);
   for(int х=0; х<всичкото_графика; х++) ChartSetSymbolPeriod(ч_графикчките[х],_Symbol,PERIOD_M1);
   for(int у=0; у<всичкото_графика; у++) ChartRedraw(ч_графикчките[у]);
   for(int й=0; й<всичкото_графика; й++) ChartClose(ч_графикчките[й]);
   ObjectsDeleteAll(0,"Секундичка");
  }

Works perfectly now.

 
kypa:

That's just brilliant. Thank you, sir!



Works perfectly now.

Please can you write the code in English. It will help. :)

 
jaffer wilson: Please can you write the code in English. It will help. :)

They are just variable names which you can replace with your own. What is important is the functionality being demonstrated. Besides, you can quickly run it through an online translator if you really want to see English variables names.

 
Fernando Carreiro:

They are just variable names which you can replace with your own. What is important is the functionality being demonstrated. Besides, you can quickly run it through an online translator if you really want to see English variables names.

But I wanted you to do it for me! /s

 

Online translators can't translate this. ( ͡° ͜ʖ ͡°)


The class is for building seconds charts by the way, I have a little more to write and I'll post the whole thing.

It is the first class I have ever written, that is the reason it has to be in Bulgarian.

 
kypa:

Online translators can't translate this. ( ͡° ͜ʖ ͡°)

https://www.mql5.com/ru/forum/1111/page2308#comment_8999405

 

Good thing I saw that thread by the way, I didn't know about MetaQuotes-Beta server and I wanted the undocked charts for quite some time. Thanks for that (it was your post explaining it).

Also what could be the reason for type suggestions not working with Cyrillic (probably Unicode) characters? Is it supposed to be like that or just some wrong language settings on my system?

 
Building micro timeframes for news trading.
Files:
Reason: