In MetaTrader v5 history files are encrypted so you can't read them form external source, but obviously in MQL5 you can read the data directly so there is no need o use the Kernal32 library.
In MetaTrader v4 history files are not encrypted, but also you can read the data directly as well without the need for the Kernal32 library.
As I have stated, in MetaTrader v5, you can't read the History file directly because it is encrypted, but you can just read the data directly by using the CopyRates() function. You can even read tick data directly as well with the CopyTicksRange() function.
Even on MetaTrader v4, there is no need to read the history directly, unless you are trying to circumvent the Strategy Tester to look ahead and thus produce false trading results, which is unethical.
I have given you the link to the documentation which includes example code.
There are also examples in the CodeBase: https://www.mql5.com/en/search#!keyword=CopyRates&module=mql5_module_codebase
Learn to use the Search function!

- www.mql5.com
thanyou
Anyone able to help. History folder in mql5 is different from mql4.
Also in mql4, you have history based on timeframe (in .hst format) whereas in mql5 there is no timeframe ( format in HCC).
Can someone explain more
It has already been explained. Read the entire thread please.
It has already been explained. Read the entire thread please.
thank you. Saw it.
As I have stated, in MetaTrader v5, you can't read the History file directly because it is encrypted, but you can just read the data directly by using the CopyRates() function. You can even read tick data directly as well with the CopyTicksRange() function.
Even on MetaTrader v4, there is no need to read the history directly, unless you are trying to circumvent the Strategy Tester to look ahead and thus produce false trading results, which is unethical.
Hello, I wonder if you could help me about this topic: "
Do you know if this is also ILEGAL ? In my opinion its clear death sentence but people are much more tolerative to liars than I am, and I know nothing about the laws about this.
Is there like some institution or email where I can report such business or EA ? I got a client wanting to convert such vile system from mt4 to mt5 and I'm afraid they has ruined too many life's already.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
How can I read the history file using kernell32 library in mql4 and mql5?