Using same functions

 

Is it possible to create an EA/indicator/script, that has my "best of functions" that I can "Call/use" for my indicators and EA (like a DLL). So I don´t have to add these functions in every EA or indicator, maybe just "include" this in the header?

 
search for MQH file how this works
 

"qjol" you helped me again!

Thank you for all support!

 

Two fast questions:

I couldn´t read anywhere that I have to compile the "*.mqh" file, should I?
- When I downloaded a file https://c.mql5.com/mql4/book/mq4/include/check.mqh according to a guide, the compiler complained about "start function not run", but I could see a compiled file. Also the "include <blabla.mqh>" refers to a mqh-file, so it had to be uncompiled?!?

Is it ok to have more than 1 function in 1 mqh-file?
- This maybe a dumb question... But I rather ask...

 
IntraTrade:

Two fast questions:

I couldn´t read anywhere that I have to compile the "*.mqh" file, should I?

no need

- When I downloaded a file https://c.mql5.com/mql4/book/mq4/include/check.mqh according to a guide, the compiler complained about "start function not run", but I could see a compiled file. Also the "include <blabla.mqh>" refers to a mqh-file, so it had to be uncompiled?!?

Is it ok to have more than 1 function in 1 mqh-file?

yes

- This maybe a dumb question... But I rather ask...

 
IntraTrade:

Is it possible to create an EA/indicator/script, that has my "best of functions" that I can "Call/use" for my indicators and EA (like a DLL). So I don´t have to add these functions in every EA or indicator, maybe just "include" this in the header?

I practice storing as many re-usable functions as I have, into "Master" library, then create header for different combination calls. I surely recommend this approach. Its time-saving, and convenient, verily.
 
diostar:
I practice storing as many re-usable functions as I have, into "Master" library, then create header for different combination calls. I surely recommend this approach. Its time-saving, and convenient, verily.


You mean a mqh-file? If not, could you give me a simple example?

Reason: