Hi, everyone - happy new year!
Is it possible to trigger the OnTick() or Start() function of a EA - if I put this EA on an offline chart?
Seems it will not trigger.
Is there any workaround that can make it trigger OnTick()?
Thanks a lot!
https://www.mql5.com/en/docs/runtime/running
For what I understand, the execution are all based on event...means that there must be an Event to trigger whatever you want to process on your program.
Unless you can create your own event that can be used on the terminal, or you can find other Event means that would trigger your codes -- such as instead using Ontick(), I would use OnChartEvent() to process my codes during offline mode. This way any chart based event like by just moving a mouse on chart would trigger to process my program:
//+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { ChartSetInteger(0,CHART_EVENT_MOUSE_MOVE,0,1); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { if(id==CHARTEVENT_MOUSE_MOVE) { Print("Lparm: ",lparam,"Dparm: ",dparam,"StateMouse: ", (uint)sparam); // Place your codes here... } }
... and for script on Start()... why not just create a certain controlled loop to continuously process whatever you want your program do.
![Documentation on MQL5: MQL5 programs / Program Running Documentation on MQL5: MQL5 programs / Program Running](/i/community/logo_mql5_small.png)
- www.mql5.com
use Start() or OnTimer()
with RefreshRates() to get new data
thanks for your replies - does that mean offline chart CAN trigger Start() but not onTick()?
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, everyone - happy new year!
Is it possible to trigger the OnTick() or Start() function of a EA - if I put this EA on an offline chart?
Seems it will not trigger.
Is there any workaround that can make it trigger OnTick() / Start()?
Thanks a lot!