Cannot modify fibo description in indicator that created fibo object

 

In an indicator, I'm trying to modify the fibo description of a fibo object I created. The code to create the object works fine:

ObjectCreate(objFibID,OBJ_FIBO,0,Time[HighestBar],High[HighestBar],Time[LowestBar],Low[LowestBar]);

"HighestBar" and "LowestBar" are integer variables.

After a couple ObjectSet commands to change the color and line style, I have this:

for (int i = 0; i < ObjectGet(objFibID,OBJPROP_FIBOLEVELS); i++)
   ObjectSetFiboDescription(objFibID,i,DoubleToStr(ObjectGet(objFibID,OBJPROP_FIRSTLEVEL+i)*100,1)+"  %$");

I tried executing the ObjectGet(objFibID,OBJPROP_FIBOLEVELS) function and assigning returned value to a variable prior to the for loop, it returned a value of 0 (and executing GetLastError() immediately afterward also returned a 0 indicating no error). If I take that out of the for loop and use the constant 32, it still doesn't work, it returns a 4201 error for all levels, including those that are there. This is code I use that works in an EA, yet it doesn't work when the fibo is created within the indicator using ObjectCreate. Do I have something wrong or is there a reason it doesn't work for fib objects created in the indicator?

Thanks!

 
I have seen something like this before . . . when I investigated it I found that you cannot label the levels unless you first define the level values, see my comment in this post: https://www.mql5.com/ru/code/9997
 
RaptorUK:
I have seen something like this before . . . when I investigated it I found that you cannot label the levels unless you first define the level values, see my comment in this post: https://www.mql5.com/ru/code/9997


Thanks, RaptorUK!

Funny thing is I tried setting the number of FibLevels and all the fib lines except 0 line disappeared, I didn't take it the step further to redefine the percentages for each level.

Reason: