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

To add comments, please log in or register
kypa
1028
kypa  

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)?

fxsaber
10581
fxsaber  

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...
kypa
1028
kypa  

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.

jaffer wilson
918
jaffer wilson  
kypa:

That's just brilliant. Thank you, sir!



Works perfectly now.

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

Fernando Carreiro
4722
Fernando Carreiro  
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.

nicholi shen
2156
nicholi shen  
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

kypa
1028
kypa  

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.

fxsaber
10581
fxsaber  
kypa:

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

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

kypa
1028
kypa  

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?

kypa
1028
kypa  
Building micro timeframes for news trading.
Files:
To add comments, please log in or register