MultiLineMovingAverage - MetaTrader 5 Script - MT4/MT5 Resources

The MultiLineMovingAverage indicator displays the levels of six moving averages of different time frames in the active chart window.
The parameters of the moving average are set for each period, and you can also enable/disable the display of the moving average for the time range you need/don't need.
The indicator was first implemented in MQL4 and published in the code base: mql4.com June 3, 2011.
Input parameters:
//+------------------------------------------------+ //|Indicator input parameters | //+------------------------------------------------+ Input string level name = "Multiline Moving Average 1" ; // Action level name input string level comment = "Multiline Moving Average" ; // action level comment Input ENUM_TEXT_POSITION TxtPos=right; // text position Input unit text size = 15 ; // text size Input color Up_levels_color=lime; // Up moving average color Input color fl_levels_color=grey; // Moving average level color Input color Dn_levels_color=red; // Falling MA levels color Enter number of candles per unit = 10 ; // level length //--- Input Boolean value display_MA1= true ; //Display MA level Input ENUM_TIMEFRAMES time range 1= PERIOD_M5 ; // MA time range Input ENUM_MA_METHOD MA1_S method = mode_EMA ; // Smooth MA method Input unit MA1_length = 10 ; // moving average period Input unit MA1_Signal_Bar= 1 ; // MA signal bar Enter ENUM_APPLIED_PRICE application price 1= PRICE_CLOSE ; // application price Input ENUM_LINE_STYLE level1_style= style_entity ; // Driver level style Input ENUM_WIDTH level1_width=w_2; // Drive level width //--- Input Boolean value display_MA2= true ; //Display MA level Input ENUM_TIMEFRAMES time range 2= PERIOD_M30 ; // MA time range Input ENUM_MA_METHOD MA2_S method = mode_EMA ; // Smooth MA method Input unit MA2_length = 10 ; // moving average period Input unit MA2_Signal_Bar= 1 ; // MA signal bar Enter ENUM_APPLIED_PRICE application price 2= PRICE_CLOSE ; // application price Input ENUM_LINE_STYLE level2_style= style_entity ; // Driver level style Input ENUM_WIDTH level2_width=w_2; // Drive level width //--- Input Boolean value display_MA3= true ; //Display MA level Input ENUM_TIMEFRAMES time range 3= PERIOD_H2 ; // MA time range Enter ENUM_MA_METHOD MA3_S method=lass="macro">Mode_EMA; // Smooth MA method input unit MA3_length = 10 ; // Moving average period input unit MA3_Signal_Bar= 1 ; // MA signal bar input ENUM_APPLIED_PRICE apply price3= PRICE_CLOSE ; // Apply price input ENUM_LINE_STYLE level3_style= style_entity ; // Drive level style input ENUM_WIDTH level3_width=w_2; // Drive level width // --- Input boolean display_MA4= True ; // Display MA levels input ENUM_TIMEFRAMES time range 4 = PERIOD_H4 ; // Time range input for MA ENUM_MA_METHOD MA4_S method = Mode_EMA ; // Smooth MA method input unit MA4_Length = 10 ; // Moving average period input unit MA4_Signal_Bar= 1 ; // MA Signal column input ENUM_APPLIED_PRICE application price 4= PRICE_CLOSE ; // Apply price input ENUM_LINE_STYLE level4_style= style_entity ; // Drive level style input ENUM_WIDTH level4_width=w_2; // Drive level width //--- input boolean display_MA5= true ; // Display MA level input ENUM_TIMEFRAMES time range 5= PERIOD_H12 ; // MA Time range input ENUM_MA_METHOD MA5_S method = mode_EMA ; // Smooth MA method input unit MA5_length = 10 ; // Moving average period input unit MA5_Signal_Bar= 1 ; // MA signal bar input ENUM_APPLIED_PRICE apply price 5 = PRICE_CLOSE ; // Apply price input ENUM_LINE_STYLE level5_style= style_entity ; // Drive level style input ENUM_WIDTH level5_width=w_2; // Drive level width //--- Input boolean display_MA6= True ; // Display MA level input ENUM_TIMEFRAMES time range 6= PERIOD_D1 ; // MA time range input ENUM_MA_METHOD MA6_S method= mode_EMA ; // Smooth MA method input unit MA6_length= 10 ; // Moving average period input unit MA6_Signal_Bar= 1 ; // MA signal bar input ENUM_APPLIED_PRICE application price 6= PRICE_CLOSE ;="comment">// Apply price input ENUM_LINE_STYLE level6_style= style_entity ; // Drive level style input ENUM_WIDTH level6_width=w_2; // Drive level width

Figure 1 Multi-line moving average indicator
Attachment download
📎 multilinemovingaverage.mq5 (20.88 KB)
Source: MQL5 #1037
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •