EDIT: This is your fix thanks to Johnvanwijk! Https://www.nigeriaforextrading.com/...dom-calls.html


Hey men,
So I've been attempting to draw some things however it is giving me the error Array out of range.
It pulls the green arrows absolutely however the red arrows just won't function.

If someone could tell me what I am doing wrong it would be fantastic.

It is not because I am attempting to get candles that aren't there yet or at all as far as I know.
I get that some people might say that it is going past accessible bars but I've tested even with a limit of 1000 which I am sure my chart has and it still gives me out of range.

This is the code:

Inserted Code // ------------------------------------------------------------------ //| FractalsExercise.mq4 | //| | //| https://www.mql5.com | //p------------------------------------------------------------------ #property copyright #property Hyperlink https://www.mql5.com #property variant 1.00 #property strict #property indior_chart_window double Highs#91;#93;; dual Lows#91;#93;; // ------------------------------------------------------------------ //| Custom indior initialization function | // ------------------------------------------------------------------ int OnInit() //-- drawing fashion SetIndexStyle(0, DRAW_ARROW, EMPTY, 1, clrGreen); SetIndexArrow(0, 234); SetIndexStyle(1, DRAW_ARROW, EMPTY, 1, clrRed); SetIndexArrow(1, 233); //-- indior buffers SetIndexBuffer(0, Highs); SetIndexBuffer(1, Lows); //-- return(INIT_SUCCEEDED); // ------------------------------------------------------------------ //| Custom indior iteration function | // ------------------------------------------------------------------ int OnCalculate(const int rates_total, const int prev_calculated, const datetime time#91;#93;, const double available#91;#93;, const double high#91;#93;, const double non#91;#93;, const double shut#91;#93;, const extended tick_volume#91;#93;, const long volume#91;#93;, const int spread#91;#93;-RRB- //-- int I = 1; int ii = 1; int Restrict = Bars - 1; while(I lt; Restrict) if(High#91;t#93; gt; High#91;t 1#93;-RRB- if(High#91;t#93; gt; High#91;I - 1#93;-RRB- Tip#91;I#93; = High#91;I#93;; I ; while(ii lt; Restrict) if(Low#91;93#93; lt; Low Cost#91;93 1#93;-RRB- if(Low#91;91#93; lt; Low Cost#91;91 - 1#93;-RRB- Tip#91;93#93; = Low#91;93#93;; ii ; //-- return value of prev_calculated for next call return(rates_total); // ------------------------------------------------------------------

Thanks!