How I can get count open chart window (and their handle) in MT4?

 

I find way how get count open chart window in platform MT4 and how get their handle.

I need control if open new chart window . I use for open window this code and sometimes it happens that the command

PostMessageA(hTerminal, WM_COMMAND, 33160, 0);

don´t open new chart window. I need catch this situation.

Thank you.

 
 
qjol:
4 B600 > ChartOpen ChartClose


Hi gjol,

thank you a lot. I see new build have more new, practic, function. I must study documentation.

But I not found function for open new chart with automatic EA/Indi...:-( I don´t see combination command for it.

Unfortunately, I don´t see common function, example ChartOpen( Symbol(), Period(), "my_template.tpl" );

Function ChartApplyTemplate() need parameter chartID and this get from function ChartID() but this function I must call (apply) only from new open chart...(some EA on chart)

I´m afraid that new functions fail catch event if open new chart with EA/scripts/indicator... :-( Maybe I was wrong but I don´t see code with new function MQL for it.





 

i really don't get u

long ChartId = ChartOpen("EURUSD", PERIOD_H4);
ChartApplyTemplate(ChartId, "my_template");
 
You have true, gjol. I read wrongly return value from function ChartOpen()... Thanks a lot!!!
 
Pavel Soukup:

PostMessageA(hTerminal, WM_COMMAND, 33160, 0);
  1. Since February 3, 2014 (Build 600) Strings are Unicode so the PostMessageA (A version can't work.) What's New in MQL4 - MQL4 Documentation Upgrade to MetaTrader 4 Build 600 and Higher - MQL4 Articles
  2. Perhaps you should re-read the manual. List of MQL4 Functions - MQL4 Reference
Updated MQL4 - MQL4 Reference
Updated MQL4 - MQL4 Reference
  • docs.mql4.com
Updated MQL4 - MQL4 Reference