How to color background?

 

Hi;

I have the following code that will draw a level in the installed CCI.  

   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)             
   }

The code works as shown in the figure below.



However, I would like to color the space between the zero level and the other levels (see figure above).  I tried using OBJ_RECTANGLE but that doesn't work.

Making the line thicker doesn't do the trick either and neither does using background color.

Any suggestions?


Thanks


Lode

 

Never mind.  I figured it out:  I forgot to define price for OBJ_RECTANGLE.  Rookie mistake I guess.


Thanks.