Launch init after click ok button without parameter changing

 
Hello I am trying to restart OnInit() when I click on the OK button of the standard configuration panel of mql5 even when I have not modified any parameter in my configuration

Do you have any idea in which base class of mql5 I can go to modify this behavior

Thanks in advance and have a nice day
 
micky51480:
Hello I am trying to restart OnInit() when I click on the OK button of the standard configuration panel of mql5 even when I have not modified any parameter in my configuration

Do you have any idea in which base class of mql5 I can go to modify this behavior

Thanks in advance and have a nice day

You can use:

bool  ChartSetSymbolPeriod(
   long             chart_id,     // Chart ID
   string           symbol,       // Symbol name
   ENUM_TIMEFRAMES  period        // Period
   );
ChartSetSymbolPeriod - Chart Operations - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Documentation on MQL5: Chart Operations / ChartSetSymbolPeriod
Documentation on MQL5: Chart Operations / ChartSetSymbolPeriod
  • www.mql5.com
Changes the symbol and period of the specified chart. The function is asynchronous, i.e. it sends the command and does not wait for its execution...
 

Sorry I don't see how to use it so that it launches onInit() when I click ok without changing any parameters. Do you have an example?

Thanks

 
micky51480:
Hello I am trying to restart OnInit() when I click on the OK button of the standard configuration panel of mql5 even when I have not modified any parameter in my configuration

If nothing has been changed, then there is no way to determine that this button was pressed.

 
micky51480 #:

Sorry I don't see how to use it so that it launches onInit() when I click ok without changing any parameters. Do you have an example?

Thanks

Oh right. Sorry. I was thinking more in terms of a script as a workaround.

As  fxsaber said, no can do with the native button.

If you're willing to have your own custom button, there are numerous MQL5 Articles about custom buttons, panels, and modules.

fxsaber
fxsaber
  • 2025.02.18
  • www.mql5.com
Trader's profile
 
Ryan L Johnson #:

Oh right. Sorry. I was thinking more in terms of a script as a workaround.

As  fxsaber said, no can do with the native button.

If you're willing to have your own custom button, there are numerous MQL5 Articles about custom buttons, panels, and modules.

I will look because on the mt4 code that I converted to mt5 the developer managed to do it but I do not have the mt4 source code