Proportioning 2 or more buffers with different homogeneous size, in the same window - page 2

 
WHRoeder:
Then min/max isn't fixed. Find the begin/end of the chart and compute the indicators min/max in that range.

I don't understand your suggest.

Having the WindowFirstVisibleBar(), ex. First Visible = 20

Having the min and max from Buffer[j] ex. BufferMin = 2, BufferMax = 75

I should recalculate the proportion just on this values, but I must wait for start() function, that recall SetProportion().

*Advantage:

  1. I don't read and resize all the buffer;

*Against:

  1. Sacrolling the chart we have false values, that didn't recalculate;
  2. Wait for start();

Can we insert a timer for refresh the chart every x ms?

 
nowhere:
Can we insert a timer for refresh the chart every x ms?
int init(){
    :
    QueueFakeTick();                // Enqueue a fake tick and let init() return
}
int start(){
    while(!IsStopped()){
        :
        if (IsTesting())    break;  // Return to the tester
        Sleep(1000);    RefreshRates();
    } // While
}

// https://forum.mql4.com/35406/page2#373538
#import "user32.dll"
    int PostMessageA(int hWnd,int Msg,int wParam,int lParam);
    int RegisterWindowMessageA(string lpString);
#import
void QueueFakeTick(){
    if (IsTesting()) return;
    int hwnd=WindowHandle(Symbol(), Period());
    int msg = RegisterWindowMessageA("MetaTrader4_Internal_Message");
    PostMessageA(hwnd, msg, 2, 1);
}
 

Run fine. I've just used a script. Thanks

void Refresh() {

        if ( WindowFind(Parent) > -1 ) {
        
                Exec            = true ; 
        
        }   
                
        while(Exec) {   
        
        PostMessageA(hwnd, msg, 2, 1);
        Sleep(1000);
        
        if ( WindowFind(Parent) == -1 ) {
                
                        Exec = false;
                        break;
                
                }
        }
}
Reason: