The Juice Indicator is a technical analysis tool designed to help traders visualize and identify specific momentum conditions within a financial market. Rather than displaying standard price action, it creates a separate visual window that compares the current volatility of the asset against its historical average.
Core Logic and Mechanism
The script functions by analyzing the market through two primary components:
1. Real-Time Volatility (The Dynamic Line) The tool calculates the "Standard Deviation" of the market—a measure of how much prices are fluctuating at any given moment. It specifically looks at a recent window of data (the "Length") to determine current movement intensity. In the visual display, this represents the immediate "pulse" of the market.
2. Historical Average (The Baseline) To provide context for that pulse, the script looks back at a much larger set of historical data (the "CalcBars"). It calculates the average volatility over this long period to establish a baseline. This represents what is considered "normal" behavior for the asset.
How it Identifies Opportunities
The indicator works by comparing these two values against each other:
- Comparison: By plotting the current volatility against the historical average, the tool reveals whether the market is currently experiencing an unusual surge or a period of relative calm compared to its history.
- Alert System: The script includes a monitoring feature that watches for specific "proximity" thresholds. If the current volatility exceeds the historical average by a pre-defined percentage, the system triggers a notification (visual and/or audio). This is designed to catch moments where the market moves with significant intensity relative to its typical behavior.
Summary of User Experience
For a trader, this tool acts as a momentum filter. Instead of just seeing price go up or down, it helps identify when the market is moving with enough "juice"—meaning significant strength or volatility—to potentially signal a major trend shift or an active trading opportunity.
//+------------------------------------------------------------------+
//| Juice_mod_v1.2.mq4 |
//| Copyright © 2006, Forex-TSD.com |
//| Written by IgorAD|
//| http://finance.groups.yahoo.com/group/TrendLaboratory |
//| Thanks Perky for Idea: http://fxovereasy.atspace.com/index|
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Forex-TSD.com "
#property link "http://www.forex-tsd.com/"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LimeGreen
#property indicator_color2 Orange
//---- indicator parameters
extern bool AlertsEnabled = false;
extern double AlertsProximity = 0.95;
extern string AlertsSound = "alert.wav";
extern int Length = 7;
extern double Ks = 1.0;
extern int CalcBars = 144;
extern int Advance = 70;
//---- indicator buffers
double UpBuffer[];
double DnBuffer[];
void init()
{
//---- drawing settings
SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID);
SetIndexStyle(1, DRAW_LINE, STYLE_DOT);
//---- indicator buffers mapping
SetIndexBuffer(0, UpBuffer);
SetIndexBuffer(1, DnBuffer);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("Juice v1.2 alert (" + Length + "," + Ks + ")");
SetIndexShift(1, Advance);
//---- initialization done
SetIndexEmptyValue(0, 0);
SetIndexEmptyValue(1, 0);
}
//+------------------------------------------------------------------+
//| Juice_mod_v1.2 |
//+------------------------------------------------------------------+
void start()
{
static datetime AlertTime = 0;
if (CalcBars == 0)
int NBars = Bars - Length;
else
NBars = CalcBars;
double sum = 0;
for (int i = 1; i <= NBars; i++)
sum += iStdDev(NULL, 0, Length, MODE_EMA, 0, PRICE_CLOSE, i);
double avg = sum/NBars;
for (i = Bars - Length - 1; i >= 0; i--) {
double Juice = iStdDev(NULL, 0, Length, MODE_EMA, 0, PRICE_CLOSE, i);
UpBuffer[i] = Juice;
DnBuffer[i] = Ks*avg;
if (AlertsEnabled && i == 0 && AlertTime != Time[0]) {
if (UpBuffer[0]/DnBuffer[0] >= AlertsProximity) {
AlertTime = Time[0];
Alert("Juice Indicator! ", Symbol(), " M", Period());
if (StringLen(AlertsSound) > 0)
PlaySound(AlertsSound);
}
}
}
}
Comments