help! include, library, and script!

 

Dear all

I have searched from this website and google but I still confuse about the use of this three types of file (include, library, and script).

Can anybody explain further what is the purpose of them? How will the traders use them for system design? can these three types of files used by either indicator or EA?

I know this question maybe so stupid but I really have no idea about it, please help!

Many thanks to you!

regards,

tob2011

 

This may start to answer your question: https://book.mql4.com/metaeditor/files

Also here's the best way to search questions: https://www.mql5.com/en/search

You have definitely come to the right place. You'll find plenty of pros here ready to help.

 
MisterDog:

This may start to answer your question: https://book.mql4.com/metaeditor/files

Also here's the best way to search questions: https://www.mql5.com/en/search

You have definitely come to the right place. You'll find plenty of pros here ready to help.


sigh! of course I know where do those files put and I can provide you more links from google and here.

http://www.forexfactory.com/showthread.php?t=232546

https://www.mql5.com/en/forum/131459

I have told I have read some articles about this problem and I still confuse about it. That's why I come here to ask for help.

If you are not willing to help, that's fine. But don't just throw the links back to me and ask me to search them again.

For those who are willing to help, what I just want to know is, what's the common usage of these types of file. and if I can use indicator and EA to trade, how these types of file can help me on trading. I don't need a thesis, but a clear explanation on the difference between them. If you have a link that is able to directly answer my question, it is welcomed. However, please don't just ask me to google the term and find it myself.

Many thanks.

regards,

wing

 
tob2011:


sigh! of course I know where do those files put and I can provide you more links from google and here.

http://www.forexfactory.com/showthread.php?t=232546

https://www.mql5.com/en/forum/131459

I have told I have read some articles about this problem and I still confuse about it. That's why I come here to ask for help.

If you are not willing to help, that's fine. But don't just throw the links back to me and ask me to search them again.

sigh ! it's proper behaviour to say "thank you" when someone takes the time to try and help even if their help does not help you . . .

If you are not willing to say "thank you", that's fine, but don't expect too much help in that case.

 

Hi tob2011,

Read your topic back then, but have no time.

This is script https://book.mql4.com/basics/programms . Basically script is just like an EA, except script is executed immediately without waiting for a tick. If you put script in EA folder, this script will become EA (executed by a tick) and vice versa.

I'll explain what include and library later, however, do you know what is a function like special function (init, start, deinit) and user defined function ? Well, basically what inside include and/or library is just a function that can be used by many and different EA, CI, Script. OrderSend() for example, we don't have to write OrderSend in an EA, we can write them in include or library and then later we either include or call them.

:D

 
RaptorUK:

sigh ! it's proper behaviour to say "thank you" when someone takes the time to try and help even if their help does not help you . . .

If you are not willing to say "thank you", that's fine, but don't expect too much help in that case.


Please don't just look at what you want to see.

I did say "many thanks" twice in my topic and reply, if you still think it is impolite to do so, what I can only say is "sorry about that".

On the other hand, if what someone "teaches" you to do is what you did say you have done, I really can't interpret it as "he is helping me".

 

sigh! the first word in your reply to MisterDog said it all . . .

"sigh! "

"If you are not willing to help, that's fine. But don't just throw the links back to me and ask me to search them again."

"For those who are willing to help, . . .

However, please don't just ask me to google the term and find it myself.

Many thanks."

 
onewithzachy:

Hi tob2011,

Read your topic back then, but have no time.

This is script https://book.mql4.com/basics/programms . Basically script is just like an EA, except script is executed immediately without waiting for a tick. If you put script in EA folder, this script will become EA (executed by a tick) and vice versa.

I'll explain what include and library later, however, do you know what is a function like special function (init, start, deinit) and user defined function ? Well, basically what inside include and/or library is just a function that can be used by many and different EA, CI, Script. OrderSend() for example, we don't have to write OrderSend in an EA, we can write them in include or library and then later we either include or call them.

:D


Thanks for your kind help.

Yes, I know what a function is, and I know what you said about "basically". What I really don't know is what are they used for. I saw from web that someone will use them for a kind of "DDL" (or "DLL", I can't remember), what's that means? Is it a kind of use for all these three types of file?

 

One other thing to note about Scripts, generally, but not always, a Script is meant to run once and then finish, so for example a script might be used to place an Order, or close all open positions. Scripts can also be made to run repeatedly with the addition of an infinite loop, I do this to refresh a chart even when there are no incoming ticks. Only one script can run on a chart at a time. Only one EA can run on a chart at a time . . . a chart can have many Indicators running on it though . . .

You don't need to use Includes or Libraries to write Indicators, Scripts and EAs . . . but if your code is getting big or you want to be able to re-use code on other projects they may help.

 

"except script is executed immediately without waiting for a tick"

also, what's the use of above function? why EA need to execute a command without waiting for a tick?

 
RaptorUK:

One other thing to note about Scripts, generally, but not always, a Script is meant to run once and then finish, so for example a script might be used to place an Order, or close all open positions. Scripts can also be made to run repeatedly with the addition of an infinite loop, I do this to refresh a chart even when there are no incoming ticks. Only one script can run on a chart at a time. Only one EA can run on a chart at a time . . . a chart can have many Indicators running on it though . . .

You don't need to use Includes or Libraries to write Indicators, Scripts and EAs . . . but if your code is getting big or you want to be able to re-use code on other projects they may help.


thanks a lot!

what's the advantage to use script to open order instead of an EA?

why we need to refresh a chart even when there are no incoming ticks?

what they can help if my code is big or re-use?

Reason: