EA DeInit and Init if ChartTimeframe switches (EA reload yourself) New comment Tim Rittel 2019.02.17 18:20 Hy, is it possible to force my EA to reload itself, everytime the Timeframe on the Chart is switched? //+------------------------------------------------------------------+ //| RefreshYourselfEA.mq4 | //| Copyright 2019 | //| mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2019" #property link "mql5.com" #property version "1.00" #property strict int PerioD=Period(); //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- if(Period()!=PerioD) { OnDeinit(); // here is the Question.. OnInit(); // is it possible somehow? } } //+------------------------------------------------------------------+ Mehrdad Jeddi 2019.02.17 18:29 #1 Hi, Yes,i can be done, andrew4789 2019.02.18 03:55 #2 Tim Rittel: As far as I know EA will Deinit whenever the tf is changed - for what ever reason - automatically. Reinstall, basically.Which is good, if that's what you want. ;) New comment