Modify the settings after loading the expert + SYMBOL_TRADE_STOPS_LEVEL

 

Hello,

I have two questions : 

-When the user changes the settings of the robot while trading. Is the OnInit function is re-call or is there an event when the settings are changed so that the expert can be re-checked them?

-Can the SYMBOL_TRADE_STOPS_LEVEL value change along the way on a given graph?


Thank you very much for your answers

 
  1. No, the OnInit function is not automatically re-called when the user changes the robot's settings while trading. However, you can create a custom event that triggers whenever the settings are changed and use that event to call the OnInit function or any other necessary functions to re-check the settings.

  2. Yes, the SYMBOL_TRADE_STOPS_LEVEL value can change during the trading process, based on market conditions and other factors. It is important to monitor this value and make necessary adjustments to your trading strategy to account for changes in the SYMBOL_TRADE_STOPS_LEVEL.

 
Joseph Nguyen #: No, the OnInit function is not automatically re-called when the user changes the robot's settings while trading. 

That is incorrect! It WILL be called!

Esteban Thevenon: When the user changes the settings of the robot while trading. Is the OnInit function is re-call or is there an event when the settings are changed so that the expert can be re-checked them?

If you change the Expert's Input properties, it will be re-started, and therefore the OnInt will be called again.

 
Esteban Thevenon: Can the SYMBOL_TRADE_STOPS_LEVEL value change along the way on a given graph?

Contract specifications, including the Stops Level, are not modified by brokers often, but it could change on occasion. So, it is best that your code is able to handle that.

 
Okay, thank you very much for this informations ^^
 
Will the OnBookEvent be triggered when the SYMBOL_TRADE_STOPS_LEVEL value changes?
 
Esteban Thevenon #:
Will the OnBookEvent be triggered when the SYMBOL_TRADE_STOPS_LEVEL value changes?

No.

 
Esteban Thevenon #: Will the OnBookEvent be triggered when the SYMBOL_TRADE_STOPS_LEVEL value changes?

No event at all will be triggered. However, there is no need to check the value continuously. Check the value only when you are about to place or modify a trade or when the strategy requires the information.

 
Okay, thank you very much ^^