Download MetaTrader 5

My panel breakout, when i change timeframe.

To add comments, please log in or register
Aadarsh Podiya
226
Aadarsh Podiya 2015.09.28 07:27 

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
226
Aadarsh Podiya 2015.09.29 08:25  

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
4732
Marco vd Heijden 2015.09.29 09:43  

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
226
Aadarsh Podiya 2015.09.29 12:57  
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
4732
Marco vd Heijden 2015.09.29 13:05  

check to see if

"Panel_Main"

exists.

if so skip, else create it.

Enrico Lambino
4355
Enrico Lambino 2015.09.29 13:07  

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
226
Aadarsh Podiya 2015.09.29 15:03  
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
226
Aadarsh Podiya 2015.09.29 15:04  
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
37571
Trinh Dat 2015.09.29 15:41  
Aadarsh Podiya:
can you give any MQL code example where i check

 example from MT4 

Files:
Controls.mq4 3 kb
Aadarsh Podiya
226
Aadarsh Podiya 2015.09.30 08:41  
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
37571
Trinh Dat 2015.09.30 09:37  
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