impulseMACD

Download script
impulseMACD

This tool is designed as a visual market indicator for the MetaTrader platform, intended to help traders identify specific price action signals by analyzing momentum and trend data. Instead of cluttering the screen with raw numbers, it translates complex mathematical calculations into clear, color-coded visual markers directly on your price chart.

How the Logic Works

The script functions by looking at three distinct layers of market data. It uses "Moving Averages"—which are essentially smoothed averages of recent price action—to filter out market noise and identify the underlying direction of the trend. By comparing different speeds of these averages (Fast, Slow, and Signal), the tool detects shifts in momentum.

Visual Identification

The indicator processes these calculations and highlights three specific types of market conditions on your chart using different colors:

  • Primary Signal (Aqua): The script first checks for a specific "Buy" condition based on the momentum settings. If this condition is met, it marks the area with Aqua-colored bars.
  • Secondary Signal (Magenta): If the primary buy signal is not active, the script then looks for a "Sell" condition. When this occurs, it highlights the price action in Magenta.
  • Neutral Zone (MediumPurple): If neither a specific buy nor a sell signal is currently being triggered by the underlying math, the tool displays MediumPurple bars. This helps you quickly identify periods of consolidation or neutral market sentiment where no clear trend is being detected.

User Experience

For the user, this means you don't have to manually calculate whether the market is overbought, oversold, or trending in a specific direction. The script does the "heavy lifting" by constantly scanning every price bar:

  1. It calculates the momentum trends in the background.
  2. It determines which of the three signals (Buy, Sell, or Neutral) is active.
  3. It paints the corresponding color on your chart to represent that state.

This allows for a faster visual interpretation of the market, helping you see at a glance where the momentum is shifting without needing to interpret complex raw data.

Miscellaneous
Implements a curve of type %1
12 Views
0 Downloads
0 Favorites
impulseMACD
//+------------------------------------------------------------------+
//| CoreWinTT æåëàåò Âàì óñïåõîâ è óäà÷è! :)                           
//+------------------------------------------------------------------+

#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Aqua
#property indicator_width1 2
#property indicator_color2 Aqua
#property indicator_width2 2
#property indicator_color3 Magenta
#property indicator_width3 2
#property indicator_color4 Magenta
#property indicator_width4 2 
#property indicator_color5 MediumPurple
#property indicator_width5 2
#property indicator_color6 MediumPurple
#property indicator_width6 2
extern int FastEMA = 12;
extern int SlowEMA = 29;
extern int SignalEMA = 9;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
 
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexBuffer(3,ExtMapBuffer4);
   SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexBuffer(4,ExtMapBuffer5);
   SetIndexStyle(5,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexBuffer(5,ExtMapBuffer6);
//----
   return(0);
  }
 
int start()
{
   int i;
   int counted_bars=IndicatorCounted();
//----
   i=Bars-counted_bars-1;
 while(i>=0)  
 {
   double L_1 = iCustom(NULL,0,"b_v2_macd_osmax",FastEMA,SlowEMA,SignalEMA,1,2,i); //buy 
   double L_2 = iCustom(NULL,0,"b_v2_macd_osmax",FastEMA,SlowEMA,SignalEMA,1,1,i); //sell
     
              if(L_1 != 0.0){ExtMapBuffer1[i]=High[i];ExtMapBuffer2[i]=Low[i];}
         else{if(L_2 != 0.0){ExtMapBuffer3[i]=High[i];ExtMapBuffer4[i]=Low[i];}
                                           else{ExtMapBuffer5[i]=High[i];ExtMapBuffer6[i]=Low[i];}}
              
                 
      i--;
      
}      
//----
   return(0);
}

Comments