making Fibbo with 10 level

 

Hi everyone

i try to make a fibbo with 10 level but it only show 9 of 10 and doesn't make the 10th at all

could someone help me?

double PercLevels[10]={0.382,0.502,0.618,0.786,0.88,1.27,1.5,1.61,2.00,2.61};
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
{
//---
int OT=ObjectsTotal(0,-1,-1);
 for(int i=0; i<=OT; i++)
      {
         if( ObjectGetInteger(0,ObjectName(0,i),OBJPROP_TYPE)==OBJ_FIBO)
         {
           double P1=ObjectGetDouble(0,ObjectName(0,i),OBJPROP_PRICE,0);
           double P2=ObjectGetDouble(0,ObjectName(0,i),OBJPROP_PRICE,1);
           datetime T1=(datetime)ObjectGetInteger(0,ObjectName(0,i),OBJPROP_TIME,0);
           datetime T2=(datetime)ObjectGetInteger(0,ObjectName(0,i),OBJPROP_TIME,1);
           string Obj_Name=ObjectName(0,i);
           bool OD=ObjectDelete(0,ObjectName(0,i));
           if(OD)
           Fibonacci_Retracement(0,Obj_Name,0,T1,P1,T2,P2,clrDarkGreen,STYLE_SOLID,2)
}

      }

}
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
bool Fibonacci_Retracement(const long       chart_ID=0,        
                      const string          name="FiboLevels",
                      const int             sub_window=0,      
                      datetime              time1=0,          
                      double                price1=0,          
                      datetime              time2=0,          
                      double                price2=0,         
                      const color           clr=clrOrange,        
                      const ENUM_LINE_STYLE style=STYLE_SOLID,
                      const int             width=2,           
                      const bool            back=false,       
                      const bool            selection=true,   
                      const bool            ray_right=true,   
                      const bool            hidden=true,      
                      const long            z_order=0)         
  {

   ResetLastError();
   if(ObjectCreate(chart_ID,name,OBJ_FIBO,sub_window,time1,price1,time2,price2))
     {
      ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
      ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style);
      ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,width);
      ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
      ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);
      ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);
      ObjectSetInteger(chart_ID,name,OBJPROP_RAY_RIGHT,ray_right);
      ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);
      ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);
      //**************************************************************
         for(int i=0;i<=9;i++)
     {
     
      ObjectSetDouble(chart_ID,name,OBJPROP_LEVELVALUE,i,PercLevels[i]);

      ObjectSetInteger(chart_ID,name,OBJPROP_LEVELCOLOR,i,clrOrange);
    
      ObjectSetInteger(chart_ID,name,OBJPROP_LEVELSTYLE,i,STYLE_SOLID);
     
      ObjectSetInteger(chart_ID,name,OBJPROP_LEVELWIDTH,i,2);
    
      ObjectSetString(chart_ID,name,OBJPROP_LEVELTEXT,i,DoubleToString(100*PercLevels[i],1));
     }
      Print("GetLAstError:",GetLastError());


      ChartRedraw();
      return(true);
        }
     else {
      Print(__FUNCTION__,
             ": failed to create => ",name," object! Error code = ",GetLastError());
      return(false);
          }
  }