Multi-colour Fibonacci Retracement indicator chart shift error

 
Hi all,

Attached is the source code of a custom indicator I'm editing. It's a Multi-Colour Fibonacci Retracement much like the one you use on TradingView but for MT4 in this case. However, I am unable to drag the fibonacci retracement beyond the "chart shift" limit and I don't know how to alter the code of my custom indicator to prevent this error from occurring. What's the problem?!

I'd appreciate all the help I can get, thank you!
Files:
 
Imaad Fakier: However, as you'd see in the video, I am unable to drag the fibonacci retracement beyond the "chart shift" limit and I don't know how to alter the code of my custom indicator to prevent this error from occurring. What's the problem?!
  1. No video posted. You might try ScreenToGif - Record your screen, edit and save as a gif, video or other formats

  2. Correct, you can't because there are no bars right of the chart shift.
  3. PICNIC, nothing to code.
  4. You are trying to drag to nonexistent bars. Stop trying.
 
Thank you for your response, but then what enables a default Fibonacci object and/or any default MT4 object for that matter (i.e. trend line etc) being able to be dragged beyond the chart shift limit?
 
   mT2 = iBarShift(NULL, 0, (datetime)ObjectGetInteger(0, "m.Fib", OBJPROP_TIME2));
You can't get a shift with a nonexistent bar. Then you try to use it with Time[mT2]. Just use the trendline end point's time.
 
Thank you so much! It worked! Have a terrific rest of your day!
 
William Roeder:
You can't get a shift with a nonexistent bar. Then you try to use it with Time[mT2]. Just use the trendline end point's time.

Thank you again for your help with my previous error. Although, I have a couple new errors that I can't seem to find the solutions for:

[1] As you can see in the ERROR [3] gif, when I change the zoom level, the distance between the text labels and their corresponding levels change, which is not the desired outcome. The desired outcome would be for the text labels to remain a fixed distance away from their corresponding levels regardless of a potential change in the zoom level. How could this be achieved?

[2] As you can see in the ERROR[4] gif, when I switch between various timeframes, the position of my fib will almost reset to a default position, which is not the desired outcome. The desired outcome would be for the fib to remain in its position that I left it prior to a potential switch in timeframe, let's say from the H1 -> D1 and vice-versa. What would the solution be to achieve this?

Files:
ERROR_z30.gif  72 kb
ERROR_34o.gif  222 kb
Reason: