The "Juice" indicator is a specialized visual tool designed to help traders identify market momentum and potential trend reversals by analyzing price volatility. Rather than looking at the price of an asset directly, this script transforms complex data into a simplified visual histogram that highlights whether the current market movement is exceeding a specific intensity threshold.
How the Logic Works
1. Volatility Measurement The core engine of the indicator uses a technical calculation called Standard Deviation. In plain terms, this measures how much the price is "swinging" away from its average over a specific period (defined by the Periyod setting). High volatility often precedes significant price moves, while low volatility can indicate a period of consolidation or cooling off.
2. The Baseline Adjustment (The "Level") The script doesn't just show raw volatility; it compares that volatility against a user-defined threshold known as the Level. By subtracting this level from the volatility calculation, the indicator filters out "market noise." It ignores minor fluctuations and only reacts when the market movement is strong enough to cross your specified boundary.
3. Visual Signaling The result is displayed in a separate window at the bottom of your trading chart as a two-colored histogram:
- Green Bars (Upward Momentum): When the market volatility exceeds your set threshold in a positive direction, the indicator produces green bars. This suggests that the current price action has enough strength to potentially push upward.
- Red Bars (Downward Momentum): When the market volatility exceeds the threshold in a negative direction, the indicator produces red bars. This signals that the downward pressure is significant enough to be of concern for buyers.
- Neutral Zone: If the market activity remains below your chosen Level, the indicator remains flat, signaling that there is currently insufficient movement to justify a high-conviction trend signal.
Summary for Traders
Essentially, "Juice" acts as a filter. It strips away the small, insignificant price wiggles and highlights only the moments where the market shows real "juice"—meaning significant enough momentum to potentially impact your trading strategy. By adjusting the Period and the Level, you can customize the sensitivity of the indicator to suit different timeframes or assets.
//+------------------------------------------------------------------+
//| 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