Hey fellow traders! If you've been looking for a way to spice up your trading strategy, I’ve got something special for you. I've developed a custom Bollinger Bands indicator specifically for MetaTrader 5 that goes beyond the standard moving average methods. While the default options only allow for the 'simple' moving average, my version brings additional flexibility to the table.
With this custom indicator, you can choose from various moving average methods like Exponential, Smoothed, and Linear Weighted. So, if you want to tailor your Bollinger Bands to fit your trading style, this is the tool for you!
To get started with this indicator, you’ll need to install it in your MetaTrader 5 directory. Here’s how:
C:\Users\YourUsername\AppData\Roaming\MetaQuotes\Terminal\Indicators\Examples
Here are some of the added features you can expect:

By default, the settings are configured to zero:

Here’s a sneak peek of the indicator in action, using the Linear Weighted average:

Now, let's dive into the code for those who want to explore the technical side:
//+------------------------------------------------------------------+ //| Custom Bollinger Bands Indicator | //| Developed by Lucas Vidal | //+------------------------------------------------------------------+ #property copyright "Lucas Vidal" #property link "https://www.mql5.com/en/users/lucasmoura00" #property description "Custom Bollinger Bands Indicator" #include <MovingAverages.mqh> //--- indicator properties #property indicator_chart_window #property indicator_buffers 4 #property indicator_plots 3 #property indicator_type1 DRAW_LINE #property indicator_color1 LightSeaGreen #property indicator_type2 DRAW_LINE #property indicator_color2 LightSeaGreen #property indicator_type3 DRAW_LINE #property indicator_color3 LightSeaGreen #property indicator_label1 "Middle Bands" #property indicator_label2 "Upper Bands" #property indicator_label3 "Lower Bands" //--- input parameters enum MovingAverageMethod { Simple, // 0 Exponential, // 1 Smoothed, // 2 LinearWeighted // 3 }; input MovingAverageMethod InpMaMethod = Simple; // Moving Average Method input int InpBandsPeriod=20; // Band Period input int InpBandsShift=0; // Band Shift input double InpBandsDeviations=2.0; // Deviation //--- global variables int ExtBandsPeriod, ExtBandsShift; double ExtBandsDeviations; int ExtPlotBegin=0; //--- indicator buffers double ExtMLBuffer[]; double ExtTLBuffer[]; double ExtBLBuffer[]; double ExtStdDevBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnInit() { // Initialization code here } //+------------------------------------------------------------------+
Feel free to dive into the code and tweak it to your liking! If you have any questions or need assistance, don’t hesitate to reach out. Happy trading!
Related Posts
- Unlock Trading Insights with Volume Profile + Range v6.0 for MetaTrader 5
- Mastering the Open Range Breakout Indicator for MetaTrader 5
- Unlocking the Power of Multi-Timeframe Tymen STARC Bands for MetaTrader 5
- ID Lite Info MA: A Comprehensive Indicator for MetaTrader 5
- Unlocking Trading Insights with Volume Profile + Range v6.0 for MetaTrader 5