Why don't you look at the Terminal Log? There is an entry like this:
CAppDialog: find subwindow error
And also help: ChartWindowFind
Note
If the second variant of the function (without parameters) is called from a script or Expert Advisor, the function returns -1.
And code:
//+------------------------------------------------------------------+ //| Initialize in Indicator | //+------------------------------------------------------------------+ bool CAppDialog::CreateIndicator(const int x1,const int y1,const int x2,const int y2) { int width=m_chart.WidthInPixels(); //--- geometry for the minimized state m_min_rect.LeftTop(0,0); m_min_rect.Width(width); m_min_rect.Height(CONTROLS_DIALOG_MINIMIZE_HEIGHT-2*CONTROLS_BORDER_WIDTH); //--- determine subwindow m_subwin=ChartWindowFind(); if(m_subwin==-1) { Print("CAppDialog: find subwindow error"); m_chart.Detach(); return(false); } //---

- www.mql5.com
Why don't you look at the Terminal Log? There is an entry like this:
And also help: ChartWindowFind
Note
If the second variant of the function (without parameters) is called from a script or Expert Advisor, the function returns -1.
And code:
Do you mean the Journal? There is no error entry. The only thing there is is:
expert xxxxx (EURUSD,M5) loaded successfully
custum indicator gui_test5 (EURUSD,M5) loaded succesfully
I also attached a file on how the indicator should look like if that matters
Do you mean the Journal? There is no error entry. The only thing there is is:
expert xxxxx (EURUSD,M5) loaded successfully
custum indicator gui_test5 (EURUSD,M5) loaded succesfully
I also attached a file on how the indicator should look like if that matters
Watch and study TWO tabs - these are the tabs of the log files:
Watch and study TWO tabs - these are the tabs of the log files:
Thanks for replying!
That tab (log files) is always empty.
Also, when i try to Comment ChartWindowFind(0,"TestButtons") it prints -1.
string subwindow_shortname ="TestButtons"; //In OnInit: IndicatorSetString(INDICATOR_SHORTNAME,subwindow_shortname);
It shoould be the right shortname.
But as i said, no error messages
Want to get an answer - ask the right question. I do not know what you have done there in your indicator - how many errors it contains and the like. BUT we always have a STANDARD: *** \ MQL5 \ Indicators \ Examples \ Panels \ SimplePanel \ SimplePanel.mq5
We start it in the EA
//+------------------------------------------------------------------+ //| 1.mq5 | //| Copyright © 2020, Vladimir Karputov | //+------------------------------------------------------------------+ #property copyright "Copyright © 2020, Vladimir Karputov" #property version "1.00" //--- input parameters input int Input1=9; //--- int handle_iCustom; // variable for storing the handle of the iCustom indicator //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- create handle of the indicator iCustom handle_iCustom=iCustom(Symbol(),Period(),"Examples\\Panels\\SimplePanel\\SimplePanel"); //--- if the handle is not created if(handle_iCustom==INVALID_HANDLE) { //--- tell about the failure and output the error code PrintFormat("Failed to create handle of the iCustom indicator for the symbol %s/%s, error code %d", Symbol(), EnumToString(Period()), GetLastError()); //--- the indicator is stopped early return(INIT_FAILED); } //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- } //+------------------------------------------------------------------+
and see the result:
2020.10.08 16:24:04.095 SimplePanel (EURUSD,H1) CAppDialog: find subwindow error
Now read my first post carefully.
Want to get an answer - ask the right question. I do not know what you have done there in your indicator - how many errors it contains and the like. BUT we always have a STANDARD: *** \ MQL5 \ Indicators \ Examples \ Panels \ SimplePanel \ SimplePanel.mq5
We start it in the EA
and see the result:
Now read my first post carefully.
Thanks, but i don't understand what the problem is.
I read your first post again, and the indicator doesn't need any input parameters, so it shouldn't be -1.
Also i tried the test for the invalid handle, and the handle that is being created is not invalid.
@Vladimir Karputov i tried loading another graphic indicator instead of my own (that doesn't have buttons but shows a graph in a separate window), which had the same problem in a normal window.
But when i tried it in the strategy tester, the indicator got loaded like it should and i could use the buffers. So it seems like it gets loaded currectly but there is just the problem opening the separate window.
The same happens when i use the Example-Indicator "Volumes", so it should not be a problem of my indicator itself but of the way i import it. And the handles seem to work, so ONLY the missing indicator window is the problem.
@Vladimir Karputov i tried loading another graphic indicator instead of my own (that doesn't have buttons but shows a graph in a separate window), which had the same problem in a normal window.
But when i tried it in the strategy tester, the indicator got loaded like it should and i could use the buffers. So it seems like it gets loaded currectly but there is just the problem opening the separate window.
The same happens when i use the Example-Indicator "Volumes", so it should not be a problem of my indicator itself but of the way i import it. And the handles seem to work, so ONLY the missing indicator window is the problem.
No open MQL5 code - no help. This is a technical forum
No open MQL5 code - no help. This is a technical forum

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I made my own indicator that has a separate window where it shows buttons. Alone it works like it should.
When i import it with the iCutsom function, the indicator doesn't get shown at all and also the Buffer Values stay empty.
What can i do to make it work?
Little addition: It also says the custum indicator has been loaded succesfully