The differences between object name and object label

 

Hi.. i have issues to get the name of object with Pivot Point Indicator

The indicator only have Object Label, using PlotIndexSet String :

string  labels[7] = {"R3","R2","R1","Pivot","S1","S2","S3"};
for (int i=0; i<steps; i++)
   {
      PlotIndexSetInteger(i,PLOT_DRAW_TYPE,DRAW_LINE);
      PlotIndexSetInteger(i,PLOT_LINE_COLOR,gradientColor(i,steps,inpColorFrom,inpColorTo));
      PlotIndexSetInteger(i,PLOT_LINE_STYLE,inpLineStyle);
      PlotIndexSetString(i,PLOT_LABEL,labels[i]);  // this one is for labeling the draw of object
   }            
   PlotIndexSetInteger(3,PLOT_LINE_COLOR,inpColorPivot);

My Goals is to get the label, using this:

if(ObjectFind(currChart, ObjectLabel) == 0)
     {
      Print("Symbol = ",sym,", j = ",j);
      if(ObjectGetInteger(currChart,ObjectLabel,OBJPROP_TYPE)!=OBJ_HLINE) continue;
      vBuy[j]= NormalizeDouble(ObjectGetDouble(currChart,ObjectLabel,OBJPROP_PRICE), Digits());
      slBuy[j]= NormalizeDouble((vBuy[j] - BuyStop_StopLoss*Point()), Digits());
      tpBuy[j]= NormalizeDouble((vBuy[j] + BuyStop_TakeProfit*Point()), Digits());
      Print("vBuy= ", DoubleToString(vBuy[j],Digits()),", Symbol= ", symName);
     }


can anyone enlighten me?

 
Rakhman Aries Nugroho:

Hi.. i have issues to get the name of object with Pivot Point Indicator

The indicator only have Object Label, using PlotIndexSet String :

My Goals is to get the label, using this:


can anyone enlighten me?

PLOT_LABEL is for buffers and it is not an object, what your code is doing is trying to get object but on chart there is no object.

Reason: