Juice_v2

This tool is designed as a visual momentum and volatility indicator for trading platforms. Its primary purpose is to help traders identify whether the current market movement is significant enough to act upon by filtering out minor "noise" in price action.

How the Logic Works

The indicator functions by measuring market volatility over a specific timeframe (defined by the user). It takes the standard deviation of price—which measures how much the price is fluctuating—and applies an exponential moving average to smooth out those fluctuations.

Once this calculation is performed, the tool subtracts a pre-defined "Level" value from the result. This threshold acts as a gatekeeper:

  • Above the Threshold: If the market volatility exceeds the set level, the indicator reflects positive momentum. Visually, this is represented by the histogram moving into the upper section of the display.
  • Below the Threshold: If the volatility falls below the specific level (or moves in a negative direction relative to the calculation), the indicator reflects downward momentum or lack of strength. This is represented by the histogram moving into the lower section.
  • Neutral Zone: If the data sits exactly on the threshold, the indicator remains neutral, signaling that there isn't enough clear movement to trigger a trend signal.

Summary for Traders

In simple terms, this script acts as a "strength filter." It doesn't just show you where the price is going; it shows you if the current move has enough "juice" or momentum to be significant. By looking at the histogram, you can quickly distinguish between steady market trends and insignificant price wobbles that might otherwise lead to false signals.

Miscellaneous
Implements a curve of type %1
15 Views
0 Downloads
0 Favorites
Juice_v2
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                                        Juice.mq4 |
//|                                                          Perky_z |
//|                              http://fxovereasy.atspace.com/index |
//+------------------------------------------------------------------+
#property  copyright "perky"
#property  link      "http://fxovereasy.atspace.com/index"
//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 2
#property  indicator_color1  LimeGreen
#property  indicator_color2  FireBrick
//---- indicator parameters
extern int Periyod=7;
extern double Level=0.0004;

//---- indicator buffers
double OsMAUpBuffer[];
double OsMADownBuffer[];
double OsMABuffer[];
double MACDBuffer[];
double SignalBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(5);
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,1);
   SetIndexDrawBegin(0,Level);
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2);
//---- 3 indicator buffers mapping
   if(!SetIndexBuffer(0,OsMAUpBuffer) &&
      !SetIndexBuffer(1,OsMADownBuffer) &&
      !SetIndexBuffer(2,OsMABuffer) &&
      !SetIndexBuffer(3,MACDBuffer) &&
      !SetIndexBuffer(4,SignalBuffer))
      Print("cannot set indicator buffers!");
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("Juice("+Periyod+","+Level+")");
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Moving Average of Oscillator                                     |
//+------------------------------------------------------------------+
int start()
{
//if ( Period != 5)
//{
//Alert ("Juice Is Recommended for 15 Min Chart only!!");
//}
  //{
   int limit,i;
   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;

//---- main loop
   for(i=0; i<limit; i++){
      OsMABuffer[i]=iStdDev  (NULL,0,Periyod,MODE_EMA,0,PRICE_CLOSE,i)-Level;
      
      if(OsMABuffer[i]>0){
         OsMAUpBuffer[i]=OsMABuffer[i];
         OsMADownBuffer[i]=0;
      }else if(OsMABuffer[i]<0){
         OsMADownBuffer[i]=OsMABuffer[i];
         OsMAUpBuffer[i]=0;
      }else{
         OsMAUpBuffer[i]=0;
         OsMADownBuffer[i]=0;
      }
   }
//---- done
   return(0);
  }
//+------------------------------------------------------------------+

Comments