Hello there,
Can someone guide me on how to make an EA on each chart do something once when a button is pressed in any one of the charts in the same terminal? My guess is that I need to use Global Variables here. I am using MQL4 and not MQL5.
Thanks in advance.
You can use GVs, but you could also use EventChartCustom() and broadcast the event to all charts.
Each EA is listening for the custom chart event, and takes action accordingly.
Take a look at the documentation, and this post may help too.
![EventChartCustom - Working with Events - MQL4 Reference EventChartCustom - Working with Events - MQL4 Reference](https://c.mql5.com/36/12/eventchartcustom-working-with-events.png)
- docs.mql4.com
Hello there,
Can someone guide me on how to make an EA on each chart do something once when a button is pressed in any one of the charts in the same terminal? My guess is that I need to use Global Variables here. I am using MQL4 and not MQL5.
Thanks in advance.
The code for both mt4 and mt5 will be exactly the same though
![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
Hello there,
Can someone guide me on how to make an EA on each chart do something once when a button is pressed in any one of the charts in the same terminal? My guess is that I need to use Global Variables here. I am using MQL4 and not MQL5.
Thanks in advance.