I have developed a customized chart indicator for MT5 and I need to get the previous day close price for it.
Since MT5 doesn’t have a quote field for that information (as far as I know), I’m using these functions to do so: CopyRates(_Symbol,PERIOD_D1,0,2,Buffer) and CopyClose(_Symbol,PERIOD_D1,0,2,Buffer).
But, several times during the day these functions returns error 4401 (Requested history not found).
#1: why this error happens so frequently since the history already exists? (I’m assuming it!)
#2: some other way to get previous day close price?