Update Array New comment Martin Eberhardt 2021.04.22 07:37 Hi. I'm currently working on my first EA and I have grown pretty desprate. I actually want to fill my array[0] with the recent indicator value and have the previouse value move to array[1]. void OnTick() { if(OrdersTotal()>1) return; double arr[2]= {0.0, 0.0}; for(int i= 0; i < 1000; i++){ double zigZag = iCustom(_Symbol, PERIOD_CURRENT,"ZigZag",0,i); if(zigZag != EMPTY_VALUE && zigZag != 0) {if(arr[0] == 0){arr[0] = zigZag;} else if(arr[1] == 0) {arr[1] = zigZag;}} } I tried ArrayResize as an else if statemant if the value is >=1 but it only equalized the array values. I also tried ArrayFree to no success. Is there anything I could do? Help would be much appreciated adding to array [WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. Questions from Beginners MQL5 MT5 MetaTrader 5 Keith Watford 2021.04.22 07:55 #1 Please edit your post and use the code button (Alt+S) when pasting code. EDIT your original post, please do not just post the code correctly in a new post. New comment
Hi. I'm currently working on my first EA and I have grown pretty desprate. I actually want to fill my array[0] with the recent indicator value and have the previouse value move to array[1].
I tried ArrayResize as an else if statemant if the value is >=1 but it only equalized the array values.
I also tried ArrayFree to no success. Is there anything I could do?
Help would be much appreciated