Juice v1.2 alert
Download scriptThis tool functions as a visual momentum and volatility monitor designed to help traders identify significant shifts in market activity. Rather than simply following the price, it focuses on calculating the "energy" or intensity behind price movements over a specific period.
Core Logic and Methodology
1. Volatility Measurement The underlying engine of this script uses a mathematical calculation known as Standard Deviation. By applying this to an Exponential Moving Average (EMA), the tool measures how much the price is deviating from its recent trend. This essentially tells you how "active" or "volatile" the market is at any given moment.
2. The Benchmark System The script establishes a baseline for what "normal" activity looks like. It analyzes a large historical window of data to calculate an average level of volatility. This serves as a steady reference point, allowing you to see if the current market behavior is significantly stronger or weaker than the historical norm.
3. Visual Representation On your trading chart, this logic is translated into two distinct visual elements:
- The Juice Level: A dynamic bar that represents the current, real-time volatility of the market.
- The Reference Line: A dotted line that represents the average historical volatility level.
How It Works for the Trader
The primary purpose of this script is to highlight moments of extreme market movement—often referred to as "Juice."
When the dynamic bar (current volatility) rises significantly above the reference line (average volatility), it indicates that the market is experiencing a surge in strength or a high-impact move. The tool allows you to see these spikes clearly, helping you distinguish between steady, boring price action and moments of high-intensity movement.
Automated Alerts
To ensure you don't have to watch the screen constantly, the script includes an intelligent notification system. It can be configured to send a pop-up alert when the current volatility reaches a specific percentage relative to the average. To prevent the tool from "spamming" you with multiple alerts for the same move, it includes a logic gate: it will only trigger once per significant move and will reset itself only after the market intensity has cooled down back below your defined threshold.
//+------------------------------------------------------------------+
//| 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
#property indicator_width1 4
//---- indicator parameters
extern bool AlertsEnabled = true;
extern double AlertsProximity = 0.95;
extern int Length = 7;
extern double Ks = 1.0;
extern int CalcBars = 144;
extern int Advance = 70;
//---- indicator buffers
double UpBuffer[];
double DnBuffer[];
double flag;
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 && flag == 0) {
AlertTime = Time[0];
Alert("Juice Indicator! ", Symbol(), " M", Period());flag = 1;
}
if (UpBuffer[0]/DnBuffer[0] < AlertsProximity) flag =0;
}
}
}
Comments