Can I use CArrayString from MQL5>ReferenceStandard>LibraryData>Collections>CArrayString in MQL4 programs?

 

Hi guys,

I have a question: Can I use CArrayString from MQL5>ReferenceStandard>LibraryData>Collections>CArrayString in MQL4 indicator and publish it on market?

It works for me on my MT4 terminal, but I am not sure if it will work for other MT4 users who will download indicator.

I am confused because this CArrayString can be found only in MQL5 documentation.

It says:  "MQL5 Standard Library is written in MQL5 and is designed to facilitate writing programs (indicators, scripts, experts) for end users. Library provides convenient access to the most of the internal MQL5 functions."

 

Can we use everything from this MQL5 standard library in MQL4 indicators and publish this on MQL4 market? Will it work for every MT4 user?


Example how I use CArrayString in MQL4:

#include <Arrays\ArrayString.mqh>

CArrayString ListObjects_X;

Documentation on MQL5: Standard Library
Documentation on MQL5: Standard Library
  • www.mql5.com
Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
The array classes are available for both MT4/MT5 and so should work fine.
 

@lippmaje thank you for additional confirmation.

 

I also did some homework research and I found out that after we compile mql4 file then all included libraries are included into compiled ex4 file.

I checked this out with simple experiment. I renamed library filenames and indicator is still working on chart. But when I want to compile mql4 once again it gives me error which is OK.

Here is screen how I renamed library file ArrayString.mqh and ex4 file is still working in same MT4 terminal.

Does mql4 compiler then inserts all included libraries into compiled ex4 file? If it does, then this is excellent because we don’t have to worry if users have all libraries available in theirs MT4 terminals.

renamed arraystring file

 
It looks like it works like that.