Download MetaTrader 5

Discussion of article "Use of Resources in MQL5"

To add comments, please log in or register
Are you accustomed to using the standard library? MQL5 has one!
MetaQuotes Software Corp.
Moderator
181263
MetaQuotes Software Corp. 2011.03.16 18:10 

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

Rashid Umarov
Admin
11826
Rashid Umarov 2012.03.30 11:16  

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

  • Resource files can be located only within the /MQL5 directory of the client terminal. Files outside that directory cannot be used.
  • Only *.wav and *.bmp files can be used as resource files.

Once the above actions are performed, the corresponding directives will be added to the beginning of the file. For example:

#resource "\Images\example.bmp"
or
#resource "resources\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.

Alexander Piechotta
6954
Alexander Piechotta 2012.11.26 21:16  

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.

Joshua Graham
1048
Joshua Graham 2013.02.01 04:52  
is it possible to include resources in ex4 (mt4) products?  Or is this 'resources' thing exclusively an ex5 (mt5) feature?
MetaQuotes
Admin
24951
Renat Fatkhullin 2013.02.01 05:32  
FinGeR:

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()
  {
  }
Обсуждение статьи "Использование ресурсов в MQL5"
  • www.mql5.com
Программы на MQL5 позволяют не только автоматизировать рутинные вычисления, но и создавать полноценную графическую оболочку.
MetaQuotes
Admin
24951
Renat Fatkhullin 2013.02.01 05:32  
4evermaat:
is it possible to include resources in ex4 (mt4) products?  Or is this 'resources' thing exclusively an ex5 (mt5) feature?
Only for MQL5.
Alexander Piechotta
6954
Alexander Piechotta 2013.02.01 17:32  
thanks.
yousef hammad
280
yousef hammad 2013.12.31 01:35  

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 ? 

yousef hammad
280
yousef hammad 2014.01.01 08:34  

Happy New Year :)

any answers? 

Achmad Hidayat
14766
Achmad Hidayat 2016.01.07 04:05  
yousef hammad:

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 ? 

What metaeditor version you use? The latest version is 5.00 build 1241 (22 Dec 2015).
omeleon GmbH
1719
Marco Hoerning 2016.03.24 11:22  
Since the "resource" technology is only available in mt5, how do I post a MT4 product consisting of an EA and a Custom Indicator (the EA calls the CustomIndicator) ?
12
To add comments, please log in or register