Sub Window height can't be changed manually after sub window size changed using CHART_HEIGHT_IN_PIXELS programmatically. Is it MT4 bugs???

 

Hi all.

I have recently used ChartSetInteger function to programmatically change sub window height (MT4 latest build 830). Once this code is applied to the chart, then I can't change sub window size manually afterwards.

It seems the code fixes the sub window height and even if I drag my mouse around the border, they don't even move by 1 pixel.

Does anyone experience similar bugs or errors like this or it this suppose to work like this ?

What would be possible solution to fix this problems ?

Your thought will be really appreciated.

Kind regards.

 

    if(!ChartSetInteger(0,CHART_HEIGHT_IN_PIXELS, 1, subWindowPixels))
    {
        //--- display the error message in Experts journal
        Print(__FUNCTION__+", Error Code = ",GetLastError());
        return;
    }     
 
Young Ho Seo:

Hi all.

I have recently used ChartSetInteger function to programmatically change sub window height (MT4 latest build 830). Once this code is applied to the chart, then I can't change sub window size manually afterwards.

It seems the code fixes the sub window height and even if I drag my mouse around the border, they don't even move by 1 pixel.

Does anyone experience similar bugs or errors like this or it this suppose to work like this ?

What would be possible solution to fix this problems ?

Your thought will be really appreciated.

Kind regards.

 

From my point of view it is intended behaviour. Set the height to zero for unlocking. 

There are other bugs related to the fixed window height though.

1. If you combine two subwindows, the upper one with fixed height, the lower with variable height, then try to resize the lower window, you might realize it is very difficult or impossible.

2. You may have two fixed size windows, then release the fixed size of the lower one by setting its height to zero. The lower subwindow might collapse:


3. If you resize the main window with fixed size subwindow, and entire chart might collapse:

 

 
Ovo Cz:

From my point of view it is intended behaviour. Set the height to zero for unlocking. 

There are other bugs related to the fixed window height though.

1. If you combine two subwindows, the upper one with fixed height, the lower with variable height, then try to resize the lower window, you might realize it is very difficult or impossible.

2. You may have two fixed size windows, then release the fixed size of the lower one by setting its height to zero. The lower subwindow might collapse:


3. If you resize the main window with fixed size subwindow, and entire chart might collapse:

 

This is really super demonstration of sub window size.

I got my problem solved immediately. Thanks so much Ovo.

By setting CHART_HEIGHT_IN_PIXELS = 0, you can unlock you sub window (i.e. now you can manually change your sub window size.)

However I was never be able to find such a information from MQL4 help documents though. :)

Anyway, if one working with sub window, these two video must be watched. Very good demonstration. :)


ChartSetInteger(0,CHART_HEIGHT_IN_PIXELS, 1, 0)
 

Hi all,


I am facing the same issue but in MT5 and I tried to use the same method to solve the issue. But it failed. Hence, setting the height to zero ( CHART_HEIGHT_IN_PIXELS = 0 ) doesn't seem to unlock the sub window height and allow you to manually adjust its height. I tried setting it to -1, but it still fail. So, how does one able to unlock the sub window height after setting it to a certain value in MT5?

Thanks in advance.

Kind regards.

 
mwtrade:

Hi all,


I am facing the same issue but in MT5 and I tried to use the same method to solve the issue. But it failed. Hence, setting the height to zero ( CHART_HEIGHT_IN_PIXELS = 0 ) doesn't seem to unlock the sub window height and allow you to manually adjust its height. I tried setting it to -1, but it still fail. So, how does one able to unlock the sub window height after setting it to a certain value in MT5?

Thanks in advance.

Kind regards.

I'm currently facing the same problem.

I've built a 'Maximize' button on my indicator for agility's sake, instead of having to drag the subwindow border up to the top, but when I restore the subwindow to it's original size the resize through mouse drag feature is gone. It would be nice to have a property called CHART_HEIGHT_LOCK/UNLOCK available so we could set it.

 
Antonio Augusto Morais:

I'm currently facing the same problem.

I've built a 'Maximize' button on my indicator for agility's sake, instead of having to drag the subwindow border up to the top, but when I restore the subwindow to it's original size the resize through mouse drag feature is gone. It would be nice to have a property called CHART_HEIGHT_LOCK/UNLOCK available so we could set it.

Hello, i have just came across the issue my self and managed solve the issue (Set the value to NULL after you have defined it, this seems to act as a reset) 


 if(id==CHARTEVENT_OBJECT_CLICK && sparam == " H4-Low ")

     {

      IndicatorSetInteger(INDICATOR_HEIGHT,60);

      IndicatorSetInteger(INDICATOR_HEIGHT,NULL);

     }

   if(id==CHARTEVENT_OBJECT_CLICK && sparam == " H4-Mid ")

     {

      IndicatorSetInteger(INDICATOR_HEIGHT,400);

      IndicatorSetInteger(INDICATOR_HEIGHT,NULL);

     }

   if(id==CHARTEVENT_OBJECT_CLICK && sparam == " H4-Full ")

     {

      IndicatorSetInteger(INDICATOR_HEIGHT,800);

      IndicatorSetInteger(INDICATOR_HEIGHT,NULL);

     }

 
MT4_Trade_Panel #:

Hello, i have just came across the issue my self and managed solve the issue (Set the value to NULL after you have defined it, this seems to act as a reset) 


 if(id==CHARTEVENT_OBJECT_CLICK && sparam == " H4-Low ")

     {

      IndicatorSetInteger(INDICATOR_HEIGHT,60);

      IndicatorSetInteger(INDICATOR_HEIGHT,NULL);

     }

   if(id==CHARTEVENT_OBJECT_CLICK && sparam == " H4-Mid ")

     {

      IndicatorSetInteger(INDICATOR_HEIGHT,400);

      IndicatorSetInteger(INDICATOR_HEIGHT,NULL);

     }

   if(id==CHARTEVENT_OBJECT_CLICK && sparam == " H4-Full ")

     {

      IndicatorSetInteger(INDICATOR_HEIGHT,800);

      IndicatorSetInteger(INDICATOR_HEIGHT,NULL);

     }

 Wow, this post was so helpful!  Using MT4,  I could set a sub-window height using  CHART_HEIGHT_IN_PIXELS just fine, but, I had been attempting to restore sub-window control by using 'ChartSetInteger(0,CHART_HEIGHT_IN_PIXELS,subwindow,0)'  (the final '0' size supposedly the key to restore size-ability, but no joy).

Seeing your post, I totally switched over to controlling the INDICATOR_HEIGHT instead.  It seems to work the same, when setting a specific size, and fortunately your tip to set it to NULL does indeed restore the ability to resize the subwindow height.  Problem solved.  Thanks!!

 

Hello I managed to reset the height just by putting the -1

ChartSetInteger(0,CHART_HEIGHT_IN_PIXELS,0,-1);
 

This is my code that works flawlessly on MQL5:

   input bool           InpAutoHeight=true;       //Indy automatic height
   input int            InpHeight=150;            //Indy Height

//--- This set and lock the indoicator height only if "auto height" input parameter is true
   if(InpAutoHeight) IndicatorSetInteger(INDICATOR_HEIGHT, InpHeight);
   if(!InpAutoHeight) IndicatorSetInteger(INDICATOR_HEIGHT, -1); //This actually unlock the indcator height
Reason: