ZORDER: Getting Rectangle To Show On Top

 

How can I get the rectangle to show up on top of the bars instead of behind them? Setting the zorder does not seem to work.


          int bars = 7;
          ObjectCreate(0,"basepoint",OBJ_RECTANGLE,0,TimeCurrent() - (ChartPeriod(0)*60*(bars))- (ChartPeriod(0)*50) , iOpen(0, 0, bars), TimeCurrent() - (ChartPeriod(0)*60*(bars*10)), iOpen(0, 0, 0));
          ObjectSet   ("basepoint", OBJPROP_COLOR, Magenta);       
          ObjectSet   ("basepoint", OBJPROP_ZORDER, 100);
 
Don't enable “chart on foreground.”
 

Thanks, but I'm still having trouble. Is there something wrong with my implementation? 


             int bars = 7;
             int xyz = ObjectCreate(0,"basepoint",OBJ_RECTANGLE,0,TimeCurrent() - (ChartPeriod(0)*60*(bars))- (ChartPeriod(0)*50) , iOpen(0, 0, bars), TimeCurrent() - (ChartPeriod(0)*60*(bars*10)), iOpen(0, 0, 0));
             ChartSetInteger(0,CHART_FOREGROUND, false);
             ChartSetInteger(0,CHART_BRING_TO_TOP, false);
             ObjectSet   ("basepoint", OBJPROP_COLOR, Blue);       
             ObjectSetInteger(0,"basepoint", OBJPROP_ZORDER, 1000);
             ObjectSetInteger(0,"basepoint",OBJPROP_BACK, true);
 
hknight555 #:

Thanks, but I'm still having trouble. Is there something wrong with my implementation? 


Do you understand it's about your chart settings and not the object ?
 

I've checked the program settings. It is still showing in the back layer. Here is the complete code, along with a screenshot: 


   void init() {
          ObjectsDeleteAll();
          int bars = 7;
          int xyz = ObjectCreate(0,"basepoint",OBJ_RECTANGLE,0,iTime(NULL, 0, bars-5) , iOpen(0, 0, bars), iTime(NULL, 0, bars), iOpen(0, 0, 0));
          ObjectSetInteger(0, "basepoint", OBJPROP_COLOR, Blue);       
          ObjectSetInteger(0, "basepoint", OBJPROP_ZORDER, 1000);
          ObjectSetInteger(0, "basepoint", OBJPROP_BACK, true);
          ChartSetInteger(0,CHART_BRING_TO_TOP, false);
          ChartSetInteger(0,CHART_FOREGROUND, false);
          ChartSetInteger(0,CHART_MODE, 1);
          ChartSetInteger(0,CHART_SCALE, 5);                               
   }



 
hknight555 #: I've checked the program settings. 

Chart settings. Chart → right-click → properties.