The MAMA_HTF_Signal indicator shows a trend direction or a signal generated by the MAMASign indicator at the chosen bar as a graphical object with colored trend indication or deal direction. It also triggers alerts and plays audio signals.
If the trend continues at the selected bar, the indicator displays a right arrow. Its color corresponds to the trend direction. If the trend has changed at the selected bar, the indicator displays an arrow. Its color and direction correspond to the deal direction.
All input parameters can be divided into three large groups:
- The MAMASign input parameters:
input string Symbol_=""; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Financial instrument input ENUM_TIMEFRAMES Timeframe=PERIOD_H6;Â Â // Indicator timeframe for calculation input double FastLimit = 0.5; input double SlowLimit = 0.05; input Applied_price_ IPC=PRICE_CLOSE_;Â Â Â Â Â Â // Price constant
- The input parameters of MAMA_HTF_Signal required to visualize the indicator:
//---- Indicator visualization settings input uint SignalBar=0;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Bar number for getting a signal (0 is a current bar) input string Symbols_Sirname=INDICATOR_NAME"_Label_"; // Indicator labels names input color UpSymol_Color=Lime;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Uptrend symbol color input color DnSymol_Color=Magenta;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Downtrend symbol color input color IndName_Color=DarkOrchid;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Indicator name color input uint Symbols_Size=60;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Signal symbols size input uint Font_Size=10;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Indicator name font size input int X_1=5;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Horizontal name offset input int Y_1=-15;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Vertical name offset input bool ShowIndName=true;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Displaying the indicator name input ENUM_BASE_CORNERÂ Â WhatCorner=CORNER_RIGHT_UPPER;// The corner in which to display the symbol input uint X_=0;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Horizontal offset input uint Y_=20;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // Vertical offset
- The MAMA_HTF_Signal indicator input parameters required for triggering alerts and audio signals:
//---- Alerts settings input ENUM_ALERT_MODE alert_mode=OnlySound; // Option of triggering the indication input uint AlertCount=0;Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // The number of alerts
If several MAMA_HTF_Signal indicators are to be used on one chart, each of them should have its own Symbols_Sirname (indicator labels names) string variable value.
Place the compiled indicator file MAMASign.mq5 to <terminal_data_folder>\MQL5\Indicators\.
Fig. 1. The MAMA_HTF_Signal indicator. A signal of trend continuation
Fig. 2. The MAMA_HTF_Signal indicator. A signal for a deal