As a trader, I’ve often found myself wishing for features that make my analysis smoother. One such feature is a Moving Average (MA) that can be toggled on and off with a simple button. While Trading View has this handy option, I couldn't find a similar tool in MetaTrader 5.
So, I decided to take matters into my own hands. I started by modifying an example Moving Average code from the MQL5 Metaeditor Help. With a bit of creativity, I added a button that allows you to easily show or hide the Moving Average, just like on Trading View.
If you’re looking for a similar functionality, feel free to use or tweak the code to match your trading style.
Simply hit the button to toggle the Moving Average visibility according to your preference!

Related Posts
- Hourly Buffers for Data Collection in MetaTrader 5: A Simple Guide
- Unlocking the Power of Master Tools for MetaTrader 4
- Unlock Trading Insights with Volume Profile + Range v6.0 for MetaTrader 5
- Unlocking MetaCOT 2: Your Ultimate CFTC Indicator Toolkit for MT4
- Visualize Current Trends Across All Time Frames with This MetaTrader 4 Indicator