Download MetaTrader 5

My panel breakout, when i change timeframe.

To add comments, please log in or register
Aadarsh Podiya
232
Aadarsh Podiya  

Dear Guys, I simply coding show panel on my chart. but My panel breakout when I change timeframe.  I attach screenshot where I show how my panel breakout.



below I my code:


int OnInit() {


   m_Symbol= _Symbol;

  

   
   if(ExtDialog.Create(0,m_Symbol,m_subwin,10,30,200,265)){
     //Text_Company_Name();
     //CreateLine_2();
     //Combo_execution();
     //Lot_Name_Text();
     //Price_Name_Text();
     //Button_execution();
     //Text_Web_Name();
     ExtDialog.Run();
    }else return(-1);
    ChartRedraw();
   
   return(INIT_SUCCEEDED);
}

void OnDeinit(const int reason){
   Comment("");
   ObjectsDeleteAll(0,GlobalObj);

   ExtDialog.Destroy(reason);
}
Files:
Capture.PNG 19 kb
Aadarsh Podiya
232
Aadarsh Podiya  

I notice when change timeframe two panel was create. I don't know why it will happens.

First time attach on chart :

After time frame change on chart :


#include <Controls\Dialog.mqh>


CAppDialog  ExtDialog;



int OnInit() 
  {

   if(ExtDialog.Create(0,"Panel_Main",0,10,30,200,240))
     {
      ExtDialog.Run();
     }

   ChartRedraw();

   return(INIT_SUCCEEDED);
  }
  

void OnDeinit(const int reason)
  {
   ExtDialog.Destroy(reason);
  }


void OnTick()
  {

  }


void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
  {

   ExtDialog.ChartEvent(id,lparam,dparam,sparam);


  }

Can anyone help. same code working previously . but not work in new build

Marco vd Heijden
Moderator
5930
Marco vd Heijden  

you can add to check is it already exists, if it does, then skip creation.

doing so it will always check if it is already present and never create a second.

Aadarsh Podiya
232
Aadarsh Podiya  
Marco vd Heijden:

you can add to check is it already exists, if it does, then skip creation.

doing so it will always check if it is already present and never create a second.


How can i check it, is my Panel is exists or not

Marco vd Heijden
Moderator
5930
Marco vd Heijden  

check to see if

"Panel_Main"

exists.

if so skip, else create it.

Enrico Lambino
6550
Enrico Lambino  

This issue does not occur with the example dialogs, which inherit from CAppDialog . However, in your case, you are directly using CAppDialog for the object. Have you made any changes to the CAppDialog class?

Aadarsh Podiya
232
Aadarsh Podiya  
Enrico Lambino:

This issue does not occur with the example dialogs, which inherit from CAppDialog . However, in your case, you are directly using CAppDialog for the object. Have you made any changes to the CAppDialog class?

no i didn't can give me a example
Aadarsh Podiya
232
Aadarsh Podiya  
Marco vd Heijden:

check to see if

exists.

if so skip, else create it.

can you give any MQL code example where i check
Trinh Dat
39659
Trinh Dat  
Aadarsh Podiya:
can you give any MQL code example where i check

 example from MT4 

Files:
Controls.mq4 3 kb
Aadarsh Podiya
232
Aadarsh Podiya  
Trinh Dat:

 example from MT4 


Dear Trinh Dat,

You coding file also same happen . it break the window. It notice it will happen will you complied file with new build 880 then try it and see it is happens.  I think this BUGS in new builds. Because i hope you send me the file because u know that file is working well. but now it is not working well.


Trinh Dat
39659
Trinh Dat  
Oh, it ever work good. today it make error when compile again with new version MT4
12
To add comments, please log in or register