Changing chart frame color programatically

 
I would like to change the color of the chart frame based on whether an attached EA has initiated a trade, (e.g. Blue if no trade, Green if buy, Red if sell). Are any of the Window API functions available to do this? Or is there a better way to quickly see what state a chart is in (I have many charts )
 

a better way to quickly see what state a chart is in (I have many charts )

iExposure indicator tells you sell / buy trades you have open for a Symbol() and evarage price buytrades evarage price sell trades

 

Best way is to create a object large enough to cover the open chart area. E.g. object like rectangle.

You can create the object & change color inside the EA as soon as it opens order.

 
  1. Create a rectangle
    int     MathMaxI(int a, int b){
                            if(a>b) return(a);              return(b);             }
    :
            double  bot = WindowPriceMin(),
                    top = WindowPriceMax();
            int     iVisible    = WindowFirstVisibleBar(),  // Chart Shift min 0
                    iVisEnd     = MathMaxI(iVisible-WindowBarsPerChart(), 0);
            if (top - bot > pips2dbl){ ..   // Div 0 tester bug

  2. Make the chart the foreground one.
    #include <WinUser32.mqh>
    :
      int hWnd  = WindowHandle(Symbol(),Period());
      int hFor  = GetForegroundWindow();
      if (hWnd != hFor) SetForegroundWindow (int hWnd); 

 
dineshydv:

Best way is to create a object large enough to cover the open chart area. E.g. object like rectangle.

You can create the object & change color inside the EA as soon as it opens order.

You can also create just borders (instead of creating a rectangle), by getting the chart dimensions (via OnChartEvent) , and creating/resizee surrounding borders on it, using Lines and Anchor features of those lines..

Reason: