Author: Copyright � SK, 2006
Priliv_s

This indicator is designed to provide traders with a visual representation of trend momentum by analyzing how price movements change across different time horizons. Instead of simply showing where the price is, it measures the "speed" and direction of the current trend relative to past data.

Core Logic and Functionality

The script calculates three distinct lines that represent the velocity of the market at varying scales:

  • Current Timeframe Momentum: The primary line focuses on the immediate speed of the trend within your currently active chart period. It helps identify how aggressively the price is moving right now.
  • Next Larger Timeframe Momentum: The second line calculates the trend speed for the next logical larger timeframe. This provides a broader perspective, helping you see if the current move aligns with a bigger, overarching trend.
  • Following Larger Timeframe Momentum: The third line looks even further ahead to the subsequent larger timeframe. This is useful for identifying long-term structural shifts in the market.

How it Works

The indicator operates by comparing weighted moving averages at different distances from the current price point. By calculating the difference between where the price is now and where it was in the past (at specific intervals), the script determines the "velocity" of the move.

A key feature of this tool is its dynamic adaptation: The script automatically adjusts its internal calculation parameters based on the timeframe you are viewing. Whether you are looking at a 1-minute chart or a daily chart, the indicator recalculates its "look-back" values to ensure the data remains relevant and proportionate to that specific time scale.

Visual Interpretation for Traders

For a user navigating the charts, the visual behavior of these lines serves as a guide:

  • Trend Confirmation: When the lines move in harmony (all pointing in the same direction), it indicates a strong, consistent trend across multiple timeframes.
  • Trend Reversal Signals: A significant "crossing" or shift in the direction of these lines is intended to signal a potential change in market sentiment. If the lines begin to flatten or reverse while the price is still moving, it often suggests that the momentum is fading and a reversal may be approaching.
  • Multi-Timeframe Awareness: By displaying three different layers of trend speed simultaneously, the tool allows you to see if a short-term "spike" is just a minor fluctuation or part of a much larger, sustained market move.
11 Views
0 Downloads
0 Favorites
Priliv_s
//ææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææ
// Priliv_s.mq4 
// Ðàçâîðîòíûé èíäèêàòîð.
// Ðàñïðîñòðàíÿåòñÿ áåñïëàòíî áåç îãðàíè÷åíèé.
// Ñåðãåé Êîâàë¸â, Äíåïðîïåòðîâñê, sk@mail.dnepr.net, http://autograf.dp.ua , ICQ 64015987
//--------------------------------------------------------------------------------------------------------------------
// Îòîáðàæàåò 3 ëèíèè ðàçíîãî öâåòà, ïîêàçûâàÿ ñêîðîñòü òðåíäà íà òåêóùåì, áëèæàéøåì áîëüøåì è ñëåäóþùåì áîëüøåì ÒÔ.
// Áåæåâûé öâåò ëèíèè îçíà÷àåò ðàñ÷¸ò ñ íàèìåíüøèì ïåðèîäîì (òåêóùèé ÒÔ). Çåë¸íûé öâåò - îòîáðàæåíèå â òåêóùåì ÒÔ 
// ëèíèè áëèæàéøåãî ñòàðøåãî ÒÔ. Êðàñíàÿ ëèíèÿ èñïîëüçóåòñÿ äëÿ îòîáðàæåíèÿ òåíäåíöèè â ñëåäóþùåì ñòàðøåì ÒÔ.
// Ìîæåò ïðèìåíÿòüñÿ íà ëþáûõ òàéìôðåéìàõ. Ïåðåãèá èíäèêàòîðà îçíà÷àåò ñìåíó íàïðàâëåíèÿ òðåíäà. 
//--------------------------------------------------------------------------------------------------------------------
#property copyright "Copyright © SK, 2006"
#property link      "http://autograf.dp.ua"
//ææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææ
//
//
//ææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææ
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 White
#property indicator_color2 Wheat
#property indicator_color3 DarkSeaGreen
#property indicator_color4 DarkSalmon
//--------------------------------------------------------------------------------------------------------------------
extern int CountBars=5000;

int i,n,k, counted_bars, K2, K3, Period_MA_2, Period_MA_3;
int Period_MA_0 = 8;
int Period_MA_1 = 21;
int Kol_Line=20;
//--------------------------------------------------------------------------------------------------------------------
double Buf_1[];                                                            // Áóôôåð îïîðíîé MA
double Buf_2[];                                                            // Áóôôåð èíäèêàòîðà òåêóùåãî ÒÔ
double Buf_3[];                                                            // Áóôôåð èíäèêàòîðà áëèæàéøåãî áîëüøåãî ÒÔ
double Buf_4[];                                                            // Áóôôåð èíäèêàòîðà ñëåäóþùåãî áîëüøåãî ÒÔ
double MA_0, MA_11, MA_12, MA_13, MA_14;
double Polzun_1[21],Polzun_2[21],Polzun_3[21],Line[21];
double KK=1.2;
double K=5;
//ææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææ
int init()
   {
   switch(Period())
      {
      case     1: K2=5; K3=15;    break;
      case     5: K2=3; K3= 6;    break;
      case    15: K2=2; K3= 4;    break;
      case    30: K2=2; K3= 8;    break;
      case    60: K2=4; K3=24;    break;
      case   240: K2=6; K3=42;    break;
      case  1440: K2=7; K3=30;    break;
      case 10080: K2=4; K3= 0;    break;
      case 43200: K2=0; K3= 0;    break;
      }
   Polzun_1[1]=20;
   Polzun_2[1]=Polzun_1[1]*K2; Period_MA_2=Period_MA_1*K2;
   Polzun_3[1]=Polzun_1[1]*K3; Period_MA_3=Period_MA_1*K3;
   
//--------------------------------------------------------------------------------------------------------------------
   SetIndexStyle (0,DRAW_LINE);
   SetIndexBuffer(0,Buf_1);
   SetIndexDrawBegin(0, Bars-CountBars);
//--------------------------------------------------------------------------------------------------------------------
   SetIndexStyle (1,DRAW_LINE);
   SetIndexBuffer(1,Buf_2);
   SetIndexDrawBegin(1, Bars-CountBars);
//--------------------------------------------------------------------------------------------------------------------
   SetIndexStyle (2,DRAW_LINE);
   SetIndexBuffer(2,Buf_3);
   SetIndexDrawBegin(2, Bars-CountBars);
//--------------------------------------------------------------------------------------------------------------------
   SetIndexStyle (3,DRAW_LINE);
   SetIndexBuffer(3,Buf_4);
   SetIndexDrawBegin(3, Bars-CountBars);
//--------------------------------------------------------------------------------------------------------------------
   return(0);
   }
//ææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææ
int start()
   {
//====================================================================================================================
   counted_bars=IndicatorCounted();
   i=Bars-counted_bars-1;
//--------------------------------------------------------------------------------------------------------------------
   for (n=2;n<=Kol_Line;n++)
      {
      k=n-1;   
      Polzun_1[n]=Polzun_1[k]/KK;
      Polzun_2[n]=Polzun_2[k]/KK;
      Polzun_3[n]=Polzun_3[k]/KK;
      }
//====================================================================================================================
   while(i>=0)
      {
//--------------------------------------------------------------------------------------------------------------------
      Buf_1[i]=0;                                                       
      
//--------------------------------------------------------------------------------------------------------------------
      Buf_2[i]= 0;
      MA_11 = iMA( NULL, 0, Period_MA_1, 0, MODE_LWMA, PRICE_TYPICAL, i             ); 
      for (n=1;n<=Kol_Line;n++)
         {
         MA_12 = iMA( NULL, 0, Period_MA_1, 0, MODE_LWMA, PRICE_TYPICAL, i +Polzun_1[n]);
         Line[n] = MA_11-MA_12;                                   
         Buf_2[i] = Buf_2[i]+Line[n];
         }
      Buf_2[i]= K*Buf_2[i]/Kol_Line;
      Buf_2[i]=Buf_2[i]*1000;
//--------------------------------------------------------------------------------------------------------------------
      Buf_3[i]= 0;
      MA_11 = iMA( NULL, 0, Period_MA_2, 0, MODE_LWMA, PRICE_TYPICAL, i             ); 
      for (n=1;n<=Kol_Line;n++)
         {
         MA_12 = iMA( NULL, 0, Period_MA_2, 0, MODE_LWMA, PRICE_TYPICAL, i +Polzun_2[n]);
         Line[n] = MA_11-MA_12;                                   
         Buf_3[i] = Buf_3[i]+Line[n];
         }
      Buf_3[i]= K*Buf_3[i]/Kol_Line;
      Buf_3[i]=Buf_3[i]*1000;
      if (K2==0)Buf_3[i]=0;
//--------------------------------------------------------------------------------------------------------------------
      Buf_4[i]= 0;
      MA_11 = iMA( NULL, 0, Period_MA_3, 0, MODE_LWMA, PRICE_TYPICAL, i             ); 
      for (n=1;n<=Kol_Line;n++)
         {
         MA_12 = iMA( NULL, 0, Period_MA_3, 0, MODE_LWMA, PRICE_TYPICAL, i +Polzun_3[n]);
         Line[n] = MA_11-MA_12;                                   
         Buf_4[i] = Buf_4[i]+Line[n];
         }
      Buf_4[i]= K*Buf_4[i]/Kol_Line;
      Buf_4[i]=Buf_4[i]*1000;
      if (K3==0)Buf_4[i]=0;
//--------------------------------------------------------------------------------------------------------------------
     i--;
     }
//====================================================================================================================
   return(0);
   }
//ææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææ
int deinit()
   {
   return(0);
   }
//ææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææææ

Comments