How can I read the history file using kernell32 library in mql4 and mql5?

 

How can I read the history file using kernell32 library in mql4 and mql5?

 
rod777: How can I read the history file using kernell32 library in mql4 and mql5?

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.

 
I want to do something like this in mq5
Files:
 
rod777: I want to do something like this in mq5

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.

 
thanks, can you give an example code?
 
rod777: thanks, can you give an example code?

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!

Search - MQL5.community
Search - MQL5.community
  • www.mql5.com
Searching is based on morphology and is insensitive to case. All letters, no matter of their case, will be processed as lowercase. By default, our search engine shows pages, that...
 
thanyou
 
rod777:
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

 
Oladimeji Ogunseye: 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.

 
Fernando Carreiro:

It has already been explained. Read the entire thread please.

thank you.  Saw it.

 
Fernando Carreiro #:

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: "

 circumvent the Strategy Tester to look ahead and thus produce false trading results, which is unethical.

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.
Reason: