I get the array out of range error and I cant seem to figure out why! Any help is greatly appreciated!
MqlRates PriceInfo[];
//Sorts it from the current candle to the oldest candleArraySetAsSeries(PriceInfo,true);
//Copies the price information into the arraydouble Data=CopyRates(Symbol(),PERIOD_CURRENT,0,Bars(Symbol(),PERIOD_CURRENT),PriceInfo); //THIS SHOULD HAVE PERIOD_D1Bid=NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_BID),_Digits);
Comment(StringFormat("Current price = %G\n",Bid));
double high_price[]; //Store the high pricedouble low_price[]; //Store the low pricedouble close_price[]; //Store the close priceArrayResize(high_price,no_candles+1);
ArrayResize(low_price,no_candles+1);
ArrayResize(close_price,no_candles+1);
for(int i=0; i<=no_candles; i=i+1)
{
high_price[i]=PriceInfo[i+1].high;
low_price[i]=PriceInfo[i+1].low;
close_price[i]=PriceInfo[i+1].close;
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi all,
I get the array out of range error and I cant seem to figure out why! Any help is greatly appreciated!