FIBO чтение запись поля Описание

 


Подскажите каким образом можно читать менять поле описания
мне надо вставить в поле описание при запуске "0 %$ " "23. 8 %$" и т д

ObjectCreate("Fibo", OBJ_FIBO, 0, Time[PreviousZigZag], ExtMapBuffer[LastZigZag], Time[LastZigZag], ExtMapBuffer[PreviousZigZag]);

ObjectSetFiboDescription("Fibo",0,"0 %$ M1"); // мне надо поставить и каждого уровня цену с помощью описания
ObjectSetFiboDescription("Fibo",1,"23.8 %$ M1"); // мне надо поставить и каждого уровня цену с помощью описания и т д

если руками менять ОПИСАНИЕ все ок


  
 
Установка уровней делается через дополнительный флаг OBJPROP_FIRSTLEVEL+n

ObjectSet("MyFibo", OBJPROP_FIRSTLEVEL+0,0); ObjectSetFiboDescription("MyFibo", 0,"0 %$ M1");
ObjectSet("MyFibo", OBJPROP_FIRSTLEVEL+1,23.8); ObjectSetFiboDescription("MyFibo", 1,"23.8 %$ M1");
 
Renat:
Установка уровней делается через дополнительный флаг OBJPROP_FIRSTLEVEL+n

ObjectSet("MyFibo", OBJPROP_FIRSTLEVEL+0,0); ObjectSetFiboDescription("MyFibo", 0,"0 %$ M1");
ObjectSet("MyFibo", OBJPROP_FIRSTLEVEL+1,23.8); ObjectSetFiboDescription("MyFibo", 1,"23.8 %$ M1");


Спасибо Renat!

в коде поставил, все равно не отрисовывает цены
может в чем то еще ошибка ?

 
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- indicator parameters
extern int ExtDepth=12;
extern int ExtDeviation=5;
extern int ExtBackstep=3;
 
extern color gFibo1 = Green;
extern color gFibo2 = DeepSkyBlue;
extern int gFiboStyle1 = 0;
extern int gFiboStyle2 = 3;
 
//---- indicator buffers
double ExtMapBuffer[];
double ExtMapBuffer2[];
 
int OldLastZigZag, OldPreviousZigZag;
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(2);
//---- drawing settings
   SetIndexStyle(0,DRAW_SECTION);
//---- indicator buffers mapping
   SetIndexBuffer(0,ExtMapBuffer);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexEmptyValue(0,0.0);
   ArraySetAsSeries(ExtMapBuffer,true);
   ArraySetAsSeries(ExtMapBuffer2,true);
//---- indicator short name
   IndicatorShortName("FibodrawerYZ");
//---- initialization done
   return(0);
  }
  
int deinit() {
    ObjectDelete("FiboYZ");
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   int    shift, back,lasthighpos,lastlowpos;
   double val,res;
   double curlow,curhigh,lasthigh,lastlow;
 
   for(shift=Bars-ExtDepth; shift>=0; shift--)
     {
      val=Low[Lowest(NULL,0,MODE_LOW,ExtDepth,shift)];
      if(val==lastlow) val=0.0;
      else 
        { 
         lastlow=val; 
         if((Low[shift]-val)>(ExtDeviation*Point)) val=0.0;
         else
           {
            for(back=1; back<=ExtBackstep; back++)
              {
               res=ExtMapBuffer[shift+back];
               if((res!=0)&&(res>val)) ExtMapBuffer[shift+back]=0.0; 
              }
           }
        } 
      ExtMapBuffer[shift]=val;
      //--- high
      val=High[Highest(NULL,0,MODE_HIGH,ExtDepth,shift)];
      if(val==lasthigh) val=0.0;
      else 
        {
         lasthigh=val;
         if((val-High[shift])>(ExtDeviation*Point)) val=0.0;
         else
           {
            for(back=1; back<=ExtBackstep; back++)
              {
               res=ExtMapBuffer2[shift+back];
               if((res!=0)&&(res<val)) ExtMapBuffer2[shift+back]=0.0; 
              } 
           }
        }
      ExtMapBuffer2[shift]=val;
     }
 
   // final cutting 
   lasthigh=-1; lasthighpos=-1;
   lastlow=-1;  lastlowpos=-1;
 
   for(shift=Bars-ExtDepth; shift>=0; shift--)
     {
      curlow=ExtMapBuffer[shift];
      curhigh=ExtMapBuffer2[shift];
      if((curlow==0)&&(curhigh==0)) continue;
      //---
      if(curhigh!=0)
        {
         if(lasthigh>0) 
           {
            if(lasthigh<curhigh) ExtMapBuffer2[lasthighpos]=0;
            else ExtMapBuffer2[shift]=0;
           }
         //---
         if(lasthigh<curhigh || lasthigh<0)
           {
            lasthigh=curhigh;
            lasthighpos=shift;
           }
         lastlow=-1;
        }
      //----
      if(curlow!=0)
        {
         if(lastlow>0)
           {
            if(lastlow>curlow) ExtMapBuffer[lastlowpos]=0;
            else ExtMapBuffer[shift]=0;
           }
         //---
         if((curlow<lastlow)||(lastlow<0))
           {
            lastlow=curlow;
            lastlowpos=shift;
           } 
         lasthigh=-1;
        }
     }
  
   for(shift=Bars-1; shift>=0; shift--)
     {
      if(shift>=Bars-ExtDepth) ExtMapBuffer[shift]=0.0;
      else
        {
         res=ExtMapBuffer2[shift];
         if(res!=0.0) ExtMapBuffer[shift]=res;
        }
 
     }
     
      int i=0;
      int LastZigZag, PreviousZigZag;
   
   int h=0;
   while ( ExtMapBuffer[h]==0 && ExtMapBuffer2[h]==0) {
       h++;
   }
   
   LastZigZag=h;
   
   h++;
   while(ExtMapBuffer[h]==0 && ExtMapBuffer2[h]==0) {
       h++;
   }
   
   PreviousZigZag=h;
   
   if (OldLastZigZag!=LastZigZag || OldPreviousZigZag!=PreviousZigZag) {
       OldLastZigZag=LastZigZag;
       OldPreviousZigZag=PreviousZigZag;
 
       ObjectDelete("FiboYZ");
       
       ObjectCreate("FiboYZ", OBJ_FIBO, 0, Time[PreviousZigZag], 
                    ExtMapBuffer[LastZigZag], Time[LastZigZag], 
                    ExtMapBuffer[PreviousZigZag]);
 
 
 
      ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+0,0);
      ObjectSetFiboDescription("FiboYZ",0,"0 %$ M1");
 
      ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+1,23.6);
      ObjectSetFiboDescription("FiboYZ",1,"23.6 %$ M1");
 
      ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+2,38.2);
      ObjectSetFiboDescription("FiboYZ",2,"38.2 %$ M1");
 
      ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+3,50.0);
      ObjectSetFiboDescription("FiboYZ",3,"50.0 %$ M1");
  
      ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+4,61.8);
      ObjectSetFiboDescription("FiboYZ",4,"61.8 %$ M1");
 
      ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+5,100.0);
      ObjectSetFiboDescription("FiboYZ",5,"100 %$ M1");
    
      ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+6,161.8);
      ObjectSetFiboDescription("FiboYZ",6,"161.8 %$ M1");
  
      ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+7,261.8);
      ObjectSetFiboDescription("FiboYZ",7,"261.8 %$ M1");
 
      ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+8,423.6);
      ObjectSetFiboDescription("FiboYZ",8,"423.6 %$ M1");
 
 
 
 
      ObjectSet("FiboYZ",OBJPROP_COLOR, gFibo1);
      ObjectSet("FiboYZ",OBJPROP_LEVELCOLOR, gFibo2);
      ObjectSet("FiboYZ",OBJPROP_STYLE, gFiboStyle1);
      ObjectSet("FiboYZ",OBJPROP_LEVELSTYLE, gFiboStyle2);
 
 
/*
  int ERR_NO_ERROR;
  string text;
  for(int II=0;II<32;II++)
    {
     text=ObjectGetFiboDescription("FiboYZ",II);
     //---- проверим, возможно уровней у объекта меньше, чем 32
     if(GetLastError()!=ERR_NO_ERROR) break;
     Print("FiboYZ","номер уровня: ",II," описание: ",text);
    }
*/
 
   }
}
 
Гляньте здесь - 'Объект OBJ_FIBOFAN'
Возможно, требуется предварительное указание колчисетва уровней

ObjectSet("FiboYZ",OBJPROP_FIBOLEVELS,4);

 
Rosh:
Гляньте здесь - 'Объект OBJ_FIBOFAN'
Возможно, требуется предварительное указание колчисетва уровней

ObjectSet("FiboYZ",OBJPROP_FIBOLEVELS,4);


Спасибо Rosh!

все заработало
 
//+------------------------------------------------------------------+
//|                                              Индикатор YuraZ.mq4 |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|                                        https://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link      "https://www.metaquotes.net/"
 
 
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- indicator parameters
extern int ExtDepth = 12;
extern int ExtDeviation = 5;
extern int ExtBackstep = 3;
 
extern color gFibo1 = Green;
extern color gFibo2 = DeepSkyBlue;
extern int gFiboStyle1 = 2;
extern int gFiboStyle2 = 2;
 
//---- indicator buffers
double ExtMapBuffer[];
double ExtMapBuffer2[];
 
int OldLastZigZag, OldPreviousZigZag;
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
    IndicatorBuffers(2);
    //---- drawing settings
    SetIndexStyle(0, DRAW_SECTION);
    //---- indicator buffers mapping
    SetIndexBuffer(0, ExtMapBuffer);
    SetIndexBuffer(1, ExtMapBuffer2);
    SetIndexEmptyValue(0, 0.0);
    ArraySetAsSeries(ExtMapBuffer, true);
    ArraySetAsSeries(ExtMapBuffer2, true);
    //---- indicator short name
    IndicatorShortName("FibodrawerYZ");
    //---- initialization done
    return(0);
  }
  
int deinit() 
  {
    ObjectDelete("FiboYZ");
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
    int    shift, back, lasthighpos, lastlowpos;
    double val, res;
    double curlow, curhigh, lasthigh, lastlow;
    for(shift = Bars-ExtDepth; shift >= 0; shift--)
      {
        val = Low[Lowest(NULL, 0, MODE_LOW, ExtDepth, shift)];
        if(val == lastlow) 
            val = 0.0;
        else 
          { 
            lastlow = val; 
            if((Low[shift] - val) > (ExtDeviation*Point)) 
                val = 0.0;
            else
              {
                for(back = 1; back <= ExtBackstep; back++)
                  {
                    res = ExtMapBuffer[shift+back];
                    if((res != 0) && (res > val)) 
                        ExtMapBuffer[shift+back] = 0.0; 
                  }
              }
          } 
        ExtMapBuffer[shift] = val;
        //--- high
        val = High[Highest(NULL, 0, MODE_HIGH, ExtDepth, shift)];
        if(val == lasthigh) 
            val = 0.0;
        else 
          {
            lasthigh = val;
            if((val - High[shift]) > (ExtDeviation*Point)) 
                val = 0.0;
            else
              {
                for(back = 1; back <= ExtBackstep; back++)
                  {
                    res = ExtMapBuffer2[shift+back];
                    if((res != 0) && (res < val)) 
                        ExtMapBuffer2[shift+back] = 0.0; 
                  } 
              }
          }
        ExtMapBuffer2[shift] = val;
      }
     // final cutting 
    lasthigh = -1; 
    lasthighpos = -1;
    lastlow = -1;  
    lastlowpos = -1;
    for(shift = Bars - ExtDepth; shift >= 0; shift--)
      {
        curlow = ExtMapBuffer[shift];
        curhigh = ExtMapBuffer2[shift];
        if((curlow == 0) && (curhigh == 0)) 
            continue;
        //---
        if(curhigh != 0)
          {
            if(lasthigh > 0) 
              {
                if(lasthigh < curhigh) 
                    ExtMapBuffer2[lasthighpos] = 0;
                else 
                    ExtMapBuffer2[shift] = 0;
              }
            //---
            if(lasthigh < curhigh || lasthigh < 0)
              {
                lasthigh = curhigh;
                lasthighpos = shift;
              }
            lastlow = -1;
          }
        //----
        if(curlow != 0)
          {
            if(lastlow > 0)
              {
                if(lastlow > curlow) 
                    ExtMapBuffer[lastlowpos] = 0;
                else 
                    ExtMapBuffer[shift] = 0;
              }
            //---
            if((curlow < lastlow) || (lastlow < 0))
              {
                lastlow = curlow;
                lastlowpos = shift;
              } 
            lasthigh = -1;
          }
      }
    for(shift = Bars - 1; shift >= 0; shift--)
      {
        if(shift >= Bars - ExtDepth) 
            ExtMapBuffer[shift] = 0.0;
        else
          {
            res = ExtMapBuffer2[shift];
            if(res != 0.0) 
                ExtMapBuffer[shift] = res;
          }
      }
    int i = 0;
    int LastZigZag, PreviousZigZag;
    int h = 0;
    while( ExtMapBuffer[h] == 0 && ExtMapBuffer2[h] == 0) 
      {
        h++;
      }
    LastZigZag = h;
    h++;
    while(ExtMapBuffer[h] == 0 && ExtMapBuffer2[h] == 0) 
      {
        h++;
      }
    PreviousZigZag = h;
   
    if(OldLastZigZag != LastZigZag || OldPreviousZigZag != PreviousZigZag) 
      {
        OldLastZigZag = LastZigZag;
        OldPreviousZigZag = PreviousZigZag;
        ObjectDelete("FiboYZ");
        ObjectCreate("FiboYZ", OBJ_FIBO, 0, Time[PreviousZigZag], 
                     ExtMapBuffer[LastZigZag], Time[LastZigZag], 
                     ExtMapBuffer[PreviousZigZag]);
        ObjectSet("FiboYZ", OBJPROP_COLOR, gFibo1);
        ObjectSet("FiboYZ", OBJPROP_LEVELCOLOR, gFibo2);
        ObjectSet("FiboYZ", OBJPROP_STYLE, gFiboStyle1);
        ObjectSet("FiboYZ", OBJPROP_LEVELSTYLE, gFiboStyle2);
        ObjectSet("FiboYZ", OBJPROP_FIBOLEVELS, 9);
        ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+0, 0);
        ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+1, 0.236);
        ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+2, 0.382);
        ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+3, 0.500);
        ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+4, 0.618);
        ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+5, 1.0);
        ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+6, 1.618);
        ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+7, 2.618);
        ObjectSet("FiboYZ", OBJPROP_FIRSTLEVEL+8, 4.236);
        ObjectSetFiboDescription("FiboYZ", 0, "0 %$ M1");
        ObjectSetFiboDescription("FiboYZ", 1, "23.6 %$ M1");
        ObjectSetFiboDescription("FiboYZ", 2, "38.2 %$ M1");
        ObjectSetFiboDescription("FiboYZ", 3, "50.0 %$ M1");
        ObjectSetFiboDescription("FiboYZ", 4, "61.8 %$ M1");
        ObjectSetFiboDescription("FiboYZ", 5, "100 %$ M1");
        ObjectSetFiboDescription("FiboYZ", 6, "161.8 %$ M1");
        ObjectSetFiboDescription("FiboYZ", 7, "261.8 %$ M1");                                                                
        ObjectSetFiboDescription("FiboYZ", 8, "423.6 %$ M1");
        ObjectsRedraw();        
 
 
/*
  int ERR_NO_ERROR;
  string text;
  for(int II=0;II<32;II++)
    {
     text=ObjectGetFiboDescription("FiboYZ",II);
     //---- проверим, возможно уровней у объекта меньше, чем 32
     if(GetLastError()!=ERR_NO_ERROR) break;
     Print("FiboYZ","номер уровня: ",II," описание: ",text);
    }
*/
 
      }
  }
 
// 
// FIBO 
//
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- indicator parameters
extern int ExtDepth = 12;
extern int ExtDeviation = 5;
extern int ExtBackstep = 3;
//---- 
extern color gFibo1 = Green;
extern color gFibo2 = DeepSkyBlue;
extern int gFiboStyle1 = 0;
extern int gFiboStyle2 = 3;
//---- indicator buffers
double ExtMapBuffer[];
double ExtMapBuffer2[];
 
int OldLastZigZag, OldPreviousZigZag;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
    IndicatorBuffers(2);
    //---- drawing settings
    SetIndexStyle(0,DRAW_SECTION);
    //---- indicator buffers mapping
    SetIndexBuffer(0,ExtMapBuffer);
    SetIndexBuffer(1,ExtMapBuffer2);
    SetIndexEmptyValue(0,0.0);
    ArraySetAsSeries(ExtMapBuffer,true);
    ArraySetAsSeries(ExtMapBuffer2,true);
    //---- indicator short name
    IndicatorShortName("FibodrawerYZ");
    //---- initialization done
    return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+  
int deinit() 
  {
    // ObjectDelete("FiboYZ");
  ObjectDelete("FiboYZ1"     );
   ObjectDelete("FiboYZ5"     );
   ObjectDelete("FiboYZ15"    );
   ObjectDelete("FiboYZ30"    );
   ObjectDelete("FiboYZ60"    );
   ObjectDelete("FiboYZ240"   );
   ObjectDelete("FiboYZ1440"  );
   ObjectDelete("FiboYZ10080" );
   ObjectDelete("FiboYZ43200"  );

  }
//+------------------------------------------------------------------+
//| Custom indicator start  function                                  | 
//+------------------------------------------------------------------+
int start()
  {
    int shift, back, lasthighpos, lastlowpos;
    double val, res;
    double curlow, curhigh, lasthigh, lastlow;
 
    for(shift = Bars - ExtDepth; shift >= 0; shift--)
      {
        val = Low[Lowest(NULL, 0, MODE_LOW, ExtDepth, shift)];
        if(val == lastlow) 
            val=0.0;
        else 
          { 
            lastlow = val; 
            if((Low[shift] - val) > (ExtDeviation*Point)) 
                val = 0.0;
            else
              {
                for(back = 1; back <= ExtBackstep; back++)
                  {
                    res = ExtMapBuffer[shift+back];
                    if((res != 0) && (res > val)) 
                        ExtMapBuffer[shift+back] = 0.0; 
                  }
              }
          } 
        ExtMapBuffer[shift] = val;
        //--- high
        val = High[Highest(NULL, 0, MODE_HIGH, ExtDepth, shift)];
        if(val == lasthigh) 
            val = 0.0;
        else 
          {
            lasthigh = val;
            if((val - High[shift]) > (ExtDeviation*Point)) 
                val = 0.0;
            else
              {
                for(back = 1; back <= ExtBackstep; back++)
                  {
                    res = ExtMapBuffer2[shift+back];
                    if((res != 0) && (res < val)) 
                        ExtMapBuffer2[shift+back] = 0.0; 
                  } 
              }
          }
        ExtMapBuffer2[shift]=val;
      }
    // final cutting 
    lasthigh = -1; 
    lasthighpos = -1;
    lastlow = -1;  
    lastlowpos = -1;

    for(shift = Bars - ExtDepth; shift >= 0; shift--)
      {
        curlow = ExtMapBuffer[shift];
        curhigh = ExtMapBuffer2[shift];
        if((curlow == 0) && (curhigh == 0)) 
            continue;
        //---
        if(curhigh != 0)
          {
            if(lasthigh > 0) 
              {
                if(lasthigh < curhigh) 
                    ExtMapBuffer2[lasthighpos] = 0;
                else 
                    ExtMapBuffer2[shift] = 0;
              }
            //---
            if(lasthigh < curhigh || lasthigh < 0)
              {
                lasthigh = curhigh;
                lasthighpos = shift;
              }
                lastlow = -1;
          }
        //----
        if(curlow != 0)
          {
            if(lastlow > 0)
              {
                if(lastlow > curlow) 
                    ExtMapBuffer[lastlowpos] = 0;
                else 
                    ExtMapBuffer[shift] = 0;
              }
            //---
            if((curlow < lastlow) || (lastlow < 0))
              {
                lastlow = curlow;
                lastlowpos = shift;
              } 
            lasthigh = -1;
          }
        }
      for(shift = Bars - 1; shift >= 0; shift--)
        {
          if(shift >= Bars - ExtDepth) 
              ExtMapBuffer[shift] = 0.0;
          else
            {
              res = ExtMapBuffer2[shift];
              if(res != 0.0) 
                  ExtMapBuffer[shift] = res;
            }
        }
      int i = 0;
      int LastZigZag, PreviousZigZag;
   
      int h = 0;
      while( ExtMapBuffer[h] == 0 && ExtMapBuffer2[h] == 0) 
        {
          h++;
        }
      LastZigZag = h;
      h++;
      while(ExtMapBuffer[h] == 0 && ExtMapBuffer2[h] == 0) 
        {
          h++;
        }
      PreviousZigZag = h;
      if(OldLastZigZag != LastZigZag || OldPreviousZigZag != PreviousZigZag) 
        {
          OldLastZigZag = LastZigZag;
          OldPreviousZigZag = PreviousZigZag;
          ObjectDelete("FiboYZ" + Period());
          ObjectCreate("FiboYZ" + Period(), OBJ_FIBO, 0, Time[PreviousZigZag], 
                       ExtMapBuffer[LastZigZag], Time[LastZigZag], 
                       ExtMapBuffer[PreviousZigZag]);
          ObjectSet("FiboYZ" + Period(),OBJPROP_FIBOLEVELS, 8);
      
          ObjectSet("FiboYZ" + Period(), OBJPROP_FIRSTLEVEL+0, 0);
          ObjectSetFiboDescription("FiboYZ" + Period(), 0, "0 %$ " + PeriodSTR(Period()));
 
          ObjectSet("FiboYZ" + Period(), OBJPROP_FIRSTLEVEL+1, 0.236);
          ObjectSetFiboDescription("FiboYZ" + Period(), 1, "23.6 %$ " + PeriodSTR(Period()));
 
          ObjectSet("FiboYZ" + Period(), OBJPROP_FIRSTLEVEL+2, 0.382);
          ObjectSetFiboDescription("FiboYZ" + Period(), 2, "38.2 %$ " + PeriodSTR(Period()));
 
          ObjectSet("FiboYZ" + Period(), OBJPROP_FIRSTLEVEL+3, 0.500);
          ObjectSetFiboDescription("FiboYZ" + Period(), 3, "50.0 %$ " + PeriodSTR(Period()));
  
          ObjectSet("FiboYZ" + Period(), OBJPROP_FIRSTLEVEL+4, 0.618);
          ObjectSetFiboDescription("FiboYZ" + Period(), 4, "61.8 %$ " + PeriodSTR(Period()));
 
          ObjectSet("FiboYZ" + Period(), OBJPROP_FIRSTLEVEL+5, 1.00);
          ObjectSetFiboDescription("FiboYZ" + Period(), 5, "100 %$ " + PeriodSTR(Period()));
    
          ObjectSet("FiboYZ" + Period(), OBJPROP_FIRSTLEVEL+6, 1.618);
          ObjectSetFiboDescription("FiboYZ" + Period(), 6, "161.8 %$ " + PeriodSTR(Period()));
  
          ObjectSet("FiboYZ" + Period(), OBJPROP_FIRSTLEVEL+7, 2.618);
          ObjectSetFiboDescription("FiboYZ" + Period(), 7, "261.8 %$ " + PeriodSTR(Period()));
 
          ObjectSet("FiboYZ" + Period(), OBJPROP_FIRSTLEVEL+8, 4.236);
          ObjectSetFiboDescription("FiboYZ" + Period(), 8, "423.6 %$ " + PeriodSTR(Period()));
      
          ObjectSet("FiboYZ" + Period(), OBJPROP_COLOR, gFibo1);
          ObjectSet("FiboYZ" + Period(), OBJPROP_LEVELCOLOR, gFibo2);
          ObjectSet("FiboYZ" + Period(), OBJPROP_STYLE, gFiboStyle1);
          ObjectSet("FiboYZ" + Period(), OBJPROP_LEVELSTYLE, gFiboStyle2);
 
        }
    }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
string  PeriodSTR(int iTF)
  {
    if(iTF == 1) // Period
        return("M1");
    if(iTF == 5)
        return("M5");
    if(iTF == 15)
        return("M15");
    if(iTF == 30)
        return("M30");
    if(iTF == 60)
        return("H1");
    if(iTF == 240)
        return("H4");
    if(iTF == 1440)
        return("D1");
    if(iTF == 10080)
        return("W1");
    if(iTF == 43200)
        return("MN1");
  }


Окончательный вариант того что хотелось получить
перемещение фибо на каждое последнее движени при смене ТФ

 
int deinit() 
  {
    ObjectsDeleteAll( 0, OBJ_FIBO);
  }
Может быть лучше так?
 
Editor писал (а):
int deinit() 
  {
    ObjectsDeleteAll( 0, OBJ_FIBO);
  }
Может быть лучше так?

Спасибо Editior
Опс ! не заметил :-) поправлю сейчас и код! выше

я бы написал
ObjectDelete("FiboYZ1" );
ObjectDelete("FiboYZ5" );
ObjectDelete("FiboYZ15" );
ObjectDelete("FiboYZ30" );
ObjectDelete("FiboYZ60" );
ObjectDelete("FiboYZ240" );
ObjectDelete("FiboYZ1440" );
ObjectDelete("FiboYZ10080" );
ObjectDelete("FiboYZ43200" );
 

а я заплатку использую, для обхода длинного описания... :)

я вот не помню, закидывал сюда, или нет....

вот:

#define _W EMPTY_VALUE
 
void Fibz(string o, double a0=_W,double a1=_W,double a2=_W,double a3=_W,double a4=_W,double a5=_W,double a6=_W,double a7=_W,double a8=_W,double a9=_W,
 double a10=_W,double a11=_W,double a12=_W,double a13=_W,double a14=_W,double a15=_W,double a16=_W,double a17=_W,double a18=_W,double a19=_W){
OS(o, OBJPROP_FIBOLEVELS, 25);int c=-1;double a=
a0; if(a!=_W){c++; OS(o,c+210,a);}a=
a1; if(a!=_W){c++; OS(o,c+210,a);}a=
a2; if(a!=_W){c++; OS(o,c+210,a);}a=
a3; if(a!=_W){c++; OS(o,c+210,a);}a=
a4; if(a!=_W){c++; OS(o,c+210,a);}a=
a5; if(a!=_W){c++; OS(o,c+210,a);}a=
a6; if(a!=_W){c++; OS(o,c+210,a);}a=
a7; if(a!=_W){c++; OS(o,c+210,a);}a=
a8; if(a!=_W){c++; OS(o,c+210,a);}a=
a9; if(a!=_W){c++; OS(o,c+210,a);}a=
a10; if(a!=_W){c++; OS(o,c+210,a);}a=
a11; if(a!=_W){c++; OS(o,c+210,a);}a=
a12; if(a!=_W){c++; OS(o,c+210,a);}a=
a13; if(a!=_W){c++; OS(o,c+210,a);}a=
a14; if(a!=_W){c++; OS(o,c+210,a);}a=
a15; if(a!=_W){c++; OS(o,c+210,a);}a=
a16; if(a!=_W){c++; OS(o,c+210,a);}a=
a17; if(a!=_W){c++; OS(o,c+210,a);}a=
a18; if(a!=_W){c++; OS(o,c+210,a);}a=
a19; if(a!=_W){c++; OS(o,c+210,a);}
OS(o, OBJPROP_FIBOLEVELS, c+1);
}/////////////////////////////////////////////////////////// 
void DFibz(string o, string a0="_",string a1="_",string a2="_",string a3="_",string a4="_",string a5="_",string a6="_",string a7="_",string a8="_",string a9="_",
 string a10="_",string a11="_",string a12="_",string a13="_",string a14="_",string a15="_",string a16="_",string a17="_",string a18="_",string a19="_"){
int c=-1;string a=
a0; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a1; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a2; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a3; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a4; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a5; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a6; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a7; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a8; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a9; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a10; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a11; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a12; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a13; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a14; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a15; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a16; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a17; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a18; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}a=
a19; if(a!="_"){c++; ObjectSetFiboDescription(o,c,a);}
}///////////////////////////////////////////////////////////


так что теперь фибы описываются просто.. например, превращаю фибо веник в веник ганна примерно так:

/////////////////////////////////////////////////////////
void fenik(string c, int b1, double p1, int b2, double p2, int sy,int C, string s=""){  
  ObjectCreate(om+c,OBJ_FIBOFAN,0,bar2time(b1),p1,bar2time(b2),p2);  
  OS(om+c, OBJPROP_LEVELCOLOR, C);
  OS(om+c, OBJPROP_RAY,0);
  OS(om+c, OBJPROP_LEVELWIDTH, sy/10);
  OS(om+c, OBJPROP_LEVELSTYLE, sy%10);
  tuneline(c, sy%10,!C , (sy/10)+1,s);
  Fibz(om+c, 0,    0.5,  -1,      0.75,  -3,    0.875,  -7);
  DFibz(om+c, 1, "1/2",   2,     "1/4",   4,    "1/8",   8);
}




Причина обращения: