Remove background color in CCI

 

Hi;

I wrote an EA that draws buy/sell zones in the CCI window that are preset in menu options.  It works as intended.

Except I would like to get rid of the zone background color and display the zone in the actual color as preset in menu options.

So 35 level in blue without the blue background and -35 in red but without the red background.


Here a pic of what it looks like now:

current display of cci levels


Here is the partial code I use to draw the levels:


   if (PositiveLevel > 0) {
      // Check if the object already exists (to avoid duplicating it)
      if (ObjectCreate("BuyZone", OBJ_HLINE, subWindow, 0, 0) == 0)   //subwindow defined earlier
      {
        // If the object already exists, delete it first
        ObjectDelete("BuyZone");
      }

      // Set the properties of the Positive line
      ObjectSetInteger(0, "BuyZone", OBJPROP_RAY_RIGHT, true);        // Extend the line to the right
      ObjectSetDouble (0, "BuyZone", OBJPROP_PRICE1, PositiveLevel);  // Price level where the line will be drawn

      // Attach the Positive line to the specified subwindow
      ObjectSetInteger(0, "BuyZone", OBJPROP_SELECTABLE, false);     // Make it not selectable
      ObjectSetInteger(0, "BuyZone", OBJPROP_SELECTED, false);       // Deselect the objectj
      ObjectSetInteger(0, "BuyZone", OBJPROP_COLOR, clrCCImax);      // Line color (you can change this)      
      ObjectSetInteger(0, "BuyZone", OBJPROP_STYLE, CCI_Style);      // Line style (you can change this)
      ObjectSetInteger(0, "BuyZone", OBJPROP_WIDTH, CCI_Width);      // Line width (you can change this)      
   }


Any suggestions anyone?


Thanks in advance


Lode

 

Hi

You need to add here a line which draw the line as background:

 ObjectSetInteger(0, "BuyZone", OBJPROP_BACK, true);

So this way the lines would not have this coloured background and price displayed – just the coloured line on the indicator chart.

Best Regards