Author: PozitiF
If you're looking to enhance your trading strategy, the MultiLineMovingAverage indicator is a must-have tool for your MetaTrader 5 platform. This powerful indicator displays six moving averages across different time frames directly on your active chart, providing a comprehensive overview of market trends.
Each moving average can be customized for specific periods, and you have the flexibility to enable or disable whichever time frames you prefer. This level of customization allows you to tailor your analysis to fit your unique trading style.
Originally developed in MQL4, the MultiLineMovingAverage was first shared on the Code Base back on June 3, 2011. It has since become a favorite among traders for its versatility and ease of use.
Input Parameters
//+------------------------------------------------+ //| Indicator input parameters | //+------------------------------------------------+ input string level_name="MultiLineMovingAverage 1"; // Name of the level input string level_comment="MultiLineMovingAverage";// Comment for the level input ENUM_TEXT_POSITION TxtPos=Right; // Position of the text input uint TextSize=15; // Size of the text input color Up_levels_color=Lime; // Color for up moving averages input color Fl_levels_color=Gray; // Color for flat moving averages input color Dn_levels_color=Red; // Color for down moving averages input uint CandleCount=10; // Number of candles to display //--- input bool display_MA1=true; // Show MA Level 1 input ENUM_TIMEFRAMES Timeframe1=PERIOD_M5; // Timeframe for MA 1 input ENUM_MA_METHOD MA1_SMethod=MODE_EMA; // Smoothing method for MA 1 input uint MA1_Length=10; // Length of MA 1 input uint MA1_Signal_Bar=1; // Signal bar for MA 1 input ENUM_APPLIED_PRICE AppliedPrice1=PRICE_CLOSE; // Applied price for MA 1 input ENUM_LINE_STYLE level1_style=STYLE_SOLID; // Line style for MA 1 input ENUM_WIDTH level1_width=w_2; // Width of MA 1 //--- input bool display_MA2=true; // Show MA Level 2 input ENUM_TIMEFRAMES Timeframe2=PERIOD_M30; // Timeframe for MA 2 input ENUM_MA_METHOD MA2_SMethod=MODE_EMA; // Smoothing method for MA 2 input uint MA2_Length=10; // Length of MA 2 input uint MA2_Signal_Bar=1; // Signal bar for MA 2 input ENUM_APPLIED_PRICE AppliedPrice2=PRICE_CLOSE; // Applied price for MA 2 input ENUM_LINE_STYLE level2_style=STYLE_SOLID; // Line style for MA 2 input ENUM_WIDTH level2_width=w_2; // Width of MA 2 //--- input bool display_MA3=true; // Show MA Level 3 input ENUM_TIMEFRAMES Timeframe3=PERIOD_H2; // Timeframe for MA 3 input ENUM_MA_METHOD MA3_SMethod=MODE_EMA; // Smoothing method for MA 3 input uint MA3_Length=10; // Length of MA 3 input uint MA3_Signal_Bar=1; // Signal bar for MA 3 input ENUM_APPLIED_PRICE AppliedPrice3=PRICE_CLOSE; // Applied price for MA 3 input ENUM_LINE_STYLE level3_style=STYLE_SOLID; // Line style for MA 3 input ENUM_WIDTH level3_width=w_2; // Width of MA 3 //--- input bool display_MA4=true; // Show MA Level 4 input ENUM_TIMEFRAMES Timeframe4=PERIOD_H4; // Timeframe for MA 4 input ENUM_MA_METHOD MA4_SMethod=MODE_EMA; // Smoothing method for MA 4 input uint MA4_Length=10; // Length of MA 4 input uint MA4_Signal_Bar=1; // Signal bar for MA 4 input ENUM_APPLIED_PRICE AppliedPrice4=PRICE_CLOSE; // Applied price for MA 4 input ENUM_LINE_STYLE level4_style=STYLE_SOLID; // Line style for MA 4 input ENUM_WIDTH level4_width=w_2; // Width of MA 4 //--- input bool display_MA5=true; // Show MA Level 5 input ENUM_TIMEFRAMES Timeframe5=PERIOD_H12; // Timeframe for MA 5 input ENUM_MA_METHOD MA5_SMethod=MODE_EMA; // Smoothing method for MA 5 input uint MA5_Length=10; // Length of MA 5 input uint MA5_Signal_Bar=1; // Signal bar for MA 5 input ENUM_APPLIED_PRICE AppliedPrice5=PRICE_CLOSE; // Applied price for MA 5 input ENUM_LINE_STYLE level5_style=STYLE_SOLID; // Line style for MA 5 input ENUM_WIDTH level5_width=w_2; // Width of MA 5 //--- input bool display_MA6=true; // Show MA Level 6 input ENUM_TIMEFRAMES Timeframe6=PERIOD_D1; // Timeframe for MA 6 input ENUM_MA_METHOD MA6_SMethod=MODE_EMA; // Smoothing method for MA 6 input uint MA6_Length=10; // Length of MA 6 input uint MA6_Signal_Bar=1; // Signal bar for MA 6 input ENUM_APPLIED_PRICE AppliedPrice6=PRICE_CLOSE; // Applied price for MA 6 input ENUM_LINE_STYLE level6_style=STYLE_SOLID; // Line style for MA 6 input ENUM_WIDTH level6_width=w_2; // Width of MA 6

Fig.1 The MultiLineMovingAverage Indicator
Comments 0