Now including resources into your MQL5 programs became even easier. To do this, MetaEditor 5 has the special Insert Resources command.
Resources Inserting
To make using of resource files in developed applications easier, the " Insert Resources" command is implemented in the "Tools" menu. This command allows declaring resource files from a selected folder in the current file using the #resource directive.
Once this command is executed, the standard dialog window of your operating system appears. In it you should select one or several resource files to be declared in the file.
|
Once the above actions are performed, the corresponding directives will be added to the beginning of the file. For example:
#resource "\Images\example.bmp" |
The path to resource files can be specified in two ways:
- Relatively to the current file (without the "\" symbol at the beginning of path)
This way is used in case the resource files are located in the same directory as the current file or in one of its subfolders. - Relatively to the /MQL5 directory of the client terminal (the "\" symbol is specified at the beginning of path)
This way is used in all other cases.
MetaTrader 5 Client Terminal build 730
MQL5: Added support for storing indicators in EX5 resources.
#resource "Examples\Fractals.ex5"
Could someone please give an example of how to use the indicator.
Could someone please give an example of how to use the indicator.
Example: https://www.mql5.com/ru/forum/3409#comment_408123
#resource "\\Indicators\\Examples\\CHO.EX5" //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- int handle=iCustom(Symbol(),Period(),"::Indicators\\Examples\\CHO.EX5"); if(handle!=INVALID_HANDLE) { Print("Indicator created!"); IndicatorRelease(handle); } //--- return(0); } void OnDeinit(const int reason) { } void OnTick() { }
- www.mql5.com
is it possible to include resources in ex4 (mt4) products? Or is this 'resources' thing exclusively an ex5 (mt5) feature?
Happy New Year :)
any answers?
i can't add any products to Market, every time i try to add ex4 file
this warning appears :
Please recompile your product with new compiler
--------------------------
and i did Compile it with the latest MetaEditor ? so what is wrong ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Use of Resources in MQL5 is published:
MQL5 programs not only automate routine calculations, but also can create a full-featured graphical environment. The functions for creating truly interactive controls are now virtually the same rich, as those in classical programming languages. If you want to write a full-fledged stand-alone program in MQL5, use resources in them. Programs with resources are easier to maintain and distribute.
Author: MetaQuotes