Author: Mns777
Y_effect_m

This technical indicator is designed to provide traders with a visual representation of market momentum and price action dynamics by analyzing historical price ranges. Rather than simply looking at where the price is now, the tool evaluates the relationship between current price movements and the volatility experienced over a specific period in the past.

Core Logic and Calculation

The indicator operates by measuring "price energy" across five consecutive bars on the chart. It calculates a cumulative base value by summing up the total range (the difference between the high and low prices) of these five bars. This sum serves as a denominator, allowing the tool to normalize price movements into a relative scale.

Operating Modes

The tool features four distinct modes that allow users to change how the "force" of the market is interpreted:

  • Mode 0 (LH): Focuses on the distance between the current low and the high from five bars ago, balanced against the total range.
  • Mode 1 (HL): Inverts the logic of the previous mode to capture different types of price pressure.
  • Mode 2 (HH): Focuses on the distance between the current high and the low from five bars ago.
  • Mode 3 (CC): Switches the logic entirely to focus on the difference between the current closing price and the closing price from five bars ago, measuring direct price displacement.

Visual Representation

The indicator appears in a separate window below your main chart as a dual-colored histogram:

  • Green Bars: These appear when the calculated upward pressure exceeds the historical volatility baseline. It suggests that the "買い" (buying) momentum is significant relative to recent price action.
  • Red Bars: These appear when downward pressure exceeds the baseline, indicating that selling momentum is dominant compared to the established range.

Practical Summary

Essentially, this script filters out "market noise" by comparing current price jumps against a 5-bar volatility average. By using different modes, traders can choose whether they want to see raw price movement (displacement) or the expansion of the trading range (volatility) as their primary signal for market strength.

Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
Y_effect_m
//+------------------------------------------------------------------+
//| Web:                                                Y(Efekt).mq4 |
//|                                                           MNS777 |
//|                                                mns777.ru@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Mns777"
#property link      ""
//----
#property indicator_separate_window
#property indicator_buffers  2
#property indicator_minimum -1
#property indicator_maximum  1
//----
#property indicator_color1 Green
#property indicator_color2 Red

extern int        mode  = 2;
extern string     modes = "0LH 1HL 2HH 3CC";

//---- òîëùèíà èíäèêàòîðíûõ ëèíèé
#property indicator_width1 2
#property indicator_width2 2
//---- ïàðàìåòðû ãîðèçîíòàëüíûõ óðîâíåé èíäèêàòîðà
#property indicator_level1  0.5
#property indicator_level2  -0.5
#property indicator_levelcolor   SlateGray
//---- Âíåøíèå ïàðàìåòðû
//---- Áóôåðû èíäèêàòîðà
double IndexBuffer[];
double ExtBuffer1[];
double ExtBuffer2[];
//---- Ïåðåìåííûå
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(3);
 
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   
   SetIndexBuffer(0,ExtBuffer1);
   SetIndexBuffer(1,ExtBuffer2);
   SetIndexBuffer(2,IndexBuffer);

   
   IndicatorShortName("(Y) Effect m"+mode+" ");
   
   SetIndexLabel(0,"Y Effect Up");
   SetIndexLabel(1,"Y Effect Dn");
   SetIndexLabel(2,"");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
 {
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int i,limit;
   int counted_bars=IndicatorCounted();
//   datetime TimeBar;
//---- ïðîâåðêà íà âîçìîæíûå îøèáêè
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- îñíîâíîé öèêë

   for(i=limit;i>=0;i--)
     {
      //Çàäàíèå çíà÷åíèé èíäåêñà èíäèêàòîðà
   
       ExtBuffer1[i]=0.0;  ExtBuffer2[i]=0.0;  

IndexBuffer[i]=(High[i]-Low[i])+(High[i+1]-Low[i+1]) +(High[i+2]-Low[i+2]) +(High[i+3]-Low[i+3])  +(High[i+4]-Low[i+4]) ;
          
   double  x01,x02,x03,  x1,x2;
    
        x01=  Low[i]  - High[i+4];
        x02=  High[i] - Low [i+4];

        x03=  Close[i] - Close[i+4];
 
 
 if (mode==0)  {  x1= x01;    x2= x02; }
 if (mode==1)  {  x1=-x02;    x2=-x01; }      
 if (mode==2)  {  x1= x02;    x2= x01; }      
 if (mode==3)  {  x1= x03;    x2= x03; }
   
   if (mode>3)mode=3;



  if(x1>0)   ExtBuffer1[i]=(High[i]- Low[i+4] )/IndexBuffer[i];
  if(x2<0)   ExtBuffer2[i]=(Low[i] - High[i+4])/IndexBuffer[i];
      
      
      }

//---- done    
   return(0);
 }
//+------------------------------------------------------------------+

Comments