ang_AZad_Css[cw]

Download script
ang_AZad_Css[cw]

This indicator is designed to provide a visual representation of price momentum and trend direction by tracking smoothed price movements on your trading chart. Instead of simply mirroring the raw price, it uses a mathematical approach to "smooth out" the noise, helping traders identify underlying trends more clearly.

Core Logic and Functionality

The script functions by calculating two distinct moving lines that react differently to price fluctuations:

1. Trend Smoothing and Momentum Tracking The tool looks at the current closing price of a candle and compares it to the previous candle's closing price. It determines if the price is currently pushing upward or downward. Based on this movement, the indicator calculates a new value by taking a percentage of the difference between the current price and the previous smoothed value.

By adjusting this calculation through a sensitivity setting (the "ki" factor), the tool determines how quickly the line should react to new price data. A higher value creates a smoother, slower-moving line, while a lower value allows the line to follow the price more closely.

2. Dual Line Analysis The script generates two separate lines on your chart:

  • Primary Line: Tracks the general flow of the price movement based on standard upward and downward momentum.
  • Secondary Line: Uses a modified logic set to capture specific nuances in price direction. By processing the relationship between current and previous prices differently, this second line acts as a complementary visual aid to help distinguish between strong trends and minor fluctuations.

How it Works for the Trader

When you apply this to a chart, the lines act as dynamic "followers" of the price action:

  • Trend Identification: When the lines move in a consistent direction (up or down) and stay smooth, it indicates a sustained trend.
  • Price Smoothing: Because the logic uses a fractional calculation rather than just averaging all past prices, it focuses on the current momentum while maintaining a "memory" of where the price has recently been.
  • Visual Shifts: The indicator automatically adjusts its starting points based on the most recent historical data to ensure that the lines are always relevant to current market conditions.

In summary, this tool is designed to filter out minor market "noise," allowing you to see the broader direction of the market through two distinct smoothed paths.

Miscellaneous
Implements a curve of type %1
18 Views
0 Downloads
0 Favorites
ang_AZad_Css[cw]
//+------------------------------------------------------------------+
//|                                               ang_AZad_Css[cw].mq4 |
//|                           Copyright © 2006, ANG3110@latchess.com |
//+------------------------------------------------------------------+

#property  copyright "ANG3110@latchess.com"
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Indigo
#property indicator_color2 DarkSlateBlue
//----
extern double ki = 2;
extern int Shift=0;
extern int zShift=0;

//----
double za[], z, za2[], z2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexBuffer(0, za);
   SetIndexShift(0, Shift);
   SetIndexBuffer(1, za2);
   SetIndexShift(1, Shift+zShift);
   SetIndexStyle(0, DRAW_LINE);
   SetIndexStyle(1, DRAW_LINE);
   SetIndexLabel(0,"ang_AZad(C)Z"+ki+",s"+Shift+"");
   SetIndexLabel(1,"ang_AZad(C)Z2"+ki+",s"+Shift+"ss"+zShift+"");

   
   IndicatorShortName("ang_AZad_Css[cw]");
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator start function                                  |
//+------------------------------------------------------------------+
int start() 
  {
   int i, cbi;
   int n, ai, bi, f, ai2, bi2, f2; 
   cbi = Bars - IndicatorCounted() - 1;
//----
   for(i = cbi; i >= 0; i--) 
     { 
       if(Close[i] > z && Close[i] > Close[i+1]) 
           z = za[i+1] + (Close[i] - za[i+1]) / ki;
       if(Close[i] < z && Close[i] < Close[i+1]) 
           z = za[i+1] + (Close[i] - za[i+1]) / ki;
       if(Close[i] > z2 && Close[i] < Close[i+1]) 
           z2 = za2[i+1] + (Close[i] - za2[i+1]) / ki;
       if(Close[i] < z2 && Close[i] > Close[i+1]) 
           z2 = za2[i+1] + (Close[i] - za2[i+1]) / ki;
       if(i > Bars - 5) 
         {
           z = Close[i]; 
           z2 = z;
         }
       za[i] = z;  
       za2[i] = z2;
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments