I would like to have void OnTick(string symbol), similar to EA which you shared.
Easy! Just create your own function. Please note that the link I sent, was not mine. Just because that code overides the OnTick function does not mean that it is future-proof or that is a safe practice.
Just create anything you want, just as long as your don't override the OnTick() function.
// Default System OnTick Event HandlervoidOnTick()
{
MyOnTick( _Symbol );
}
// My Own personalised Symbol's Tick handling functionvoid MyOnTick(string symbol)
{
// My code here
}
So, in this example, MyOnTick(string symbol) will run OnTimer(), when there is a new tick trigger from any other symbol, while MyOnTick( _Symbol ) will run only for current symbol, right?
There is any safe method to overide the OnTick function?
So, in this example, MyOnTick(string symbol) will run OnTimer(), when there is a new tick trigger from any other symbol, while MyOnTick( _Symbol ) will run only for current symbol, right?
There is any safe method to overide the OnTick function?
No, "MyOnTick()" will not run the "OnTimer()". "OnTime()" is an event handle which can then call "MyOnTick()" according to the logic that you described before. And in the same way, OnTick() can call "MyOnTick()" as well.
There is no known official safe way to override the "OnTick()" event handler, because no official documented stance exists for that.
No, "MyOnTick()" will not run the "OnTimer()". "OnTime()" is an event handle which can then call "MyOnTick()" according to the logic that you described before.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
You should not be calling OnTick() directly from another function.
How I can create separate Tick Handling function.
I would like to have void OnTick(string symbol), similar to EA which you shared.
How I can create separate Tick Handling function.
I would like to have void OnTick(string symbol), similar to EA which you shared.
Easy! Just create your own function. Please note that the link I sent, was not mine. Just because that code overides the OnTick function does not mean that it is future-proof or that is a safe practice.
Just create anything you want, just as long as your don't override the OnTick() function.
So, in this example, MyOnTick(string symbol) will run OnTimer(), when there is a new tick trigger from any other symbol, while MyOnTick( _Symbol ) will run only for current symbol, right?
There is any safe method to overide the OnTick function?
So, in this example, MyOnTick(string symbol) will run OnTimer(), when there is a new tick trigger from any other symbol, while MyOnTick( _Symbol ) will run only for current symbol, right?
There is any safe method to overide the OnTick function?
No, "MyOnTick()" will not run the "OnTimer()". "OnTime()" is an event handle which can then call "MyOnTick()" according to the logic that you described before. And in the same way, OnTick() can call "MyOnTick()" as well.
There is no known official safe way to override the "OnTick()" event handler, because no official documented stance exists for that.
No, "MyOnTick()" will not run the "OnTimer()". "OnTime()" is an event handle which can then call "MyOnTick()" according to the logic that you described before.
Everything is clear Fernando. Thank you )))