Which symbols OnTick function updates - page 2

 
Fernando Carreiro:

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. 

 
Narek Kamalyan:

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.

// Default System OnTick Event Handler
void OnTick()
{
   MyOnTick( _Symbol );
}


// My Own personalised Symbol's Tick handling function
void MyOnTick(string symbol)
{
   // My code here
}
 
Fernando Carreiro:

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?

 
Narek Kamalyan:

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.

 
Fernando Carreiro:

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