Hello everyone, how can we get a calculation of the number of candles formed from the date 2009 to 2021, for example, on the minute frame?
Hello everyone, how can we get a calculation of the number of candles formed from the date 2009 to 2021, for example, on the minute frame? i want to gets (open ,high ,low ,close) prices form 9/10/2009 to 9/10/2022 for example can any one help me please
datetime startTime = D'9.10.2009 12:30:27'; datetime endTime = D'9.10.2022 12:30:27'; ENUM_TIMEFRAMES period = PERIOD_M1; int shiftStart = iBarShift(NULL,period,startTime); int shiftEnd = iBarShift(NULL,period,endTime); MqlRates rates[]; ArraySetAsSeries(rates,true); CopyRates(NULL,PERIOD_M1,shiftStart,shiftEnd-shiftStart,rates); ArrayPrint(rates);
I tried the code, but the Forex market strength cannot obtain historical data from the year 1990 to the present time on a one-minute frame. (((((((((((((Thank you for your interest and I hope you will help me solve this problem.)))))))))))
please check this utility on codebase
study what is error by modifying this line
if(CopyRates(NULL,PERIOD_M1,shiftStart,shiftEnd-shiftStart,rates)==-1) Print(GetLastError());
then search for the error cause on forum
Check how many bars available from Tools > Options > Chart > Max bar in chart or Print
Print(TerminalInfoInteger(TERMINAL_MAXBARS));if your bars you want are not available in chart then it will fail to copy
please check this utility on codebase
study what is error by modifying this line
then search for the error cause on forum
Check how many bars available from Tools > Options > Chart > Max bar in chart or Print
if your bars you want are not available in chart then it will fail to copy
Well, my brother, the result after modifying the code was this, noting that the date was from 9/10/2022 to 9/10/2023.
Just
As shown in the picture
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everyone, how can we get a calculation of the number of candles formed from the date 2009 to 2021, for example, on the minute frame? i want to gets (open ,high ,low ,close) prices form 9/10/2009 to 9/10/2022 for example can any one help me please