What does OnInit, OnDeinit and OnTick mean?

 

What does each of these mean?

int OnInit()
void OnDeinit(const int reason)
void OnTick()

I looked all over the Internet, or I didn’t find the answer or it’s very difficult for a programmer with zero experience. Please answer in the most understandable language and with an example of finished code.
 
IgorFX Trading:

What does each of these mean?


I looked all over the Internet, or I didn’t find the answer or it’s very difficult for a programmer with zero experience. Please answer in the most understandable language and with an example of finished code.

Event Handling


Improve your searching skills.

 
IgorFX Trading:

What does each of these mean?


I looked all over the Internet, or I didn’t find the answer or it’s very difficult for a programmer with zero experience. Please answer in the most understandable language and with an example of finished code.

Simply read the MQL5 documentation

https://www.mql5.com/en/docs

Especially

https://www.mql5.com/en/docs/event_handlers

MQL5 Reference - How to use algorithmic/automated trading language for MetaTrader 5
MQL5 Reference - How to use algorithmic/automated trading language for MetaTrader 5
  • www.mql5.com
MQL5 Reference - How to use algorithmic/automated trading language for MetaTrader 5
 
_MAHA_ #:

Event Handling


Improve your searching skills


I learned the words, I don't understand them, could you show an example of a SIMPLE script? I don't understand what to write under each function. Comments or placing orders or counting take profit & stop loss. what? You can come up with a billion commands, but I won’t start. Because even if I execute the syntax correctly, it will show me multiple erros due to the fact that I wrote the command under the wrong function (not onInit, but under onTick for example). I hope you understand. I wouldn’t ask you if I just had to go to the documentation, but as always, it’s not clearly written there and 
I'm here to find out the answer to a question that I will get in a couple of hours maximum than I will sit in a documentary, understand a billion years, since nothing is clear there for novice programmers and rearrange the code from function to function. Big time.

 
IgorFX Trading #: I learned the words, I don't understand them, could you show an example of a SIMPLE script? I don't understand what to write under each function. Comments or placing orders or counting take profit & stop loss. what? You can come up with a billion commands, but I won’t start. Because even if I execute the syntax correctly, it will show me multiple erros due to the fact that I wrote the command under the wrong function (not onInit, but under onTick for example). I hope you understand. I wouldn’t ask you if I just had to go to the documentation, but as always, it’s not clearly written there and I'm here to find out the answer to a question that I will get in a couple of hours maximum than I will sit in a documentary, understand a billion years, since nothing is clear there for novice programmers and rearrange the code from function to function. Big time.

There are examples in the documentation and plenty more in the CodeBase. Take some time to read the documentation and study the examples and the CodeBase samples.

It is impossible for us to summarise our knowledge and experience with just a few posts. You will have to learn it just like all of us have done it — by reading the documentation, examples, samples in the CodeBase, books, videos, etc.

 
Fernando Carreiro #:

There are examples in the documentation and plenty more in the CodeBase. Take some time to read the documentation and study the examples and the CodeBase samples.

It is impossible for us to summarise our knowledge and experience with just a few posts. You will have to learn it just like all of us have done it — by reading the documentation, examples, samples in the CodeBase, books, videos, etc.

Alright, thanks.
Reason: