The code you provided is handling a scenario where there are no previously calculated data points ( prev_calculated == 0 ).
Your code is attempting to read and process data from a file.
@Oleksandr Medviediev why is it reading from a file if the file got zero ticks

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
https://www.mql5.com/en/articles/60