I am thinking about how to write an EA to manage trailing stops for all open orders. It will be attached to a single chart but will manage orders for every symbol.
It does not make sense to run the code from OnTick() because it will only execute when the attached chart has a new tick and may miss the new ticks for other symbols.
The only solution I can think of is to write the logic into a loop in the OnInit() function.
I have two questions:
Can I run all my code from OnInit()? Is this even feasible??
What problems might I encounter?
Hoping you guys can help me figure out if this is doable or if there is a better way. My googling skills are not up to the task apparently..!
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.
Hi All
I am thinking about how to write an EA to manage trailing stops for all open orders. It will be attached to a single chart but will manage orders for every symbol.
It does not make sense to run the code from OnTick() because it will only execute when the attached chart has a new tick and may miss the new ticks for other symbols.
The only solution I can think of is to write the logic into a loop in the OnInit() function.
I have two questions:
Hoping you guys can help me figure out if this is doable or if there is a better way. My googling skills are not up to the task apparently..!
Many Thanks
David