JuiceLevelsAlertFixedNew

Download script
JuiceLevelsAlertFixedNew

The JuiceAlerts tool is designed as a visual momentum and volatility indicator for the MetaTrader platform. Its primary goal is to categorize market activity into three distinct zones based on price fluctuations, helping traders quickly identify high-intensity movements versus quieter periods.

Core Functionality

The script calculates market "juice"—a measure of price volatility—and categorizes it into a visual histogram. It divides the data into three specific types:

  • High Volatility (Good Juice): When market movement exceeds a set high threshold, the indicator identifies this as significant activity.
  • Low Volatility (Bad Juice): When movements fall below a minimum level, it highlights periods of very low activity or "flat" markets.
  • Moderate Activity (So-So Juice): This represents the middle ground where the market is moving but hasn't hit extreme high or low limits.

Visual Representation

On your chart, this information is displayed in a separate window at the bottom. It uses a colored histogram to represent these three states:

  • Lawn Green typically indicates the "Good Juice" (high activity).
  • Orange Red signifies the "Bad Juice" (low activity).
  • Yellow represents the "So-So Juice" (moderate activity).

Additionally, the tool can draw horizontal reference lines. These serve as visual markers to help you track specific price pip levels, making it easier to see at a glance how close the current market movement is to your preferred trading boundaries.

Automated Notifications

Beyond the visual display, the script includes an integrated alert system. If the market reaches a high-volatility state (the "Good Juice" threshold) that wasn't present on the previous candle, the tool will trigger a pop-up notification. This allows you to stay informed of significant price action even when you aren't actively watching the screen.

Key User Controls

You can customize how the script behaves through several settings:

  • Sensitivity: Adjust the period and thresholds to make the indicator more or less sensitive to market changes.
  • Visibility: Toggle whether the horizontal level lines are displayed on your chart.
  • Alerts: Turn the automated notifications on or off depending on your trading style.
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
15 Views
0 Downloads
0 Favorites
JuiceLevelsAlertFixedNew
//+------------------------------------------------------------------+
//|                                                   JuiceAlerts.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 3
#property  indicator_color1  LawnGreen
#property  indicator_color2  OrangeRed
#property indicator_color3 Yellow
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2

//---- indicator parameters
extern bool DoAlerts = true;
extern int Periyod=7;
extern int thresholdLevel=8;
extern int sosoLevel = 4;
extern bool JuiceLevelsVisible = true;
extern int JuiceStartPips = 4;
extern int JuiceStepPips = 4;
extern int JuiceLevelsNumber = 3;
extern color JuiceLevelColor = Silver;

double thresholdLevelPoint;
double sosoLevelPoint;

//---- indicator buffers
double GoodJuice[];
double BadJuice[];
double SoSoJuice[];
double currentJuiceLevel;
double Juice;
double last;


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- 3 additional buffers are used for counting.
   IndicatorBuffers(3);
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID);
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID);
   SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID);
   SetIndexDrawBegin(0,Periyod);
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2);
//---- 2 indicator buffers mapping
   if(!SetIndexBuffer(0,GoodJuice) &&
      !SetIndexBuffer(1,BadJuice) &&
      !SetIndexBuffer(2,SoSoJuice))
      Print("cannot set indicator buffers!");
      
   IndicatorDigits(4);
   
   thresholdLevelPoint = thresholdLevel*Point;
   sosoLevelPoint = sosoLevel*Point;
   
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("Juice("+Periyod+","+thresholdLevel+")");

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

int SetLevelLines()
{
   string levelLabel;
   if(JuiceLevelsVisible)
   {
      SetLevelStyle(STYLE_DASH,1,JuiceLevelColor);
      for(int i=1; i<= JuiceLevelsNumber; i++)
      {
         
         currentJuiceLevel = (JuiceStartPips + (i-1)*JuiceStepPips);
         SetLevelValue(i,currentJuiceLevel);
         levelLabel = "Level "+i+": "+currentJuiceLevel;
         SetIndexLabel(i,levelLabel);
      }
   }else
   {
      for(i=1; i<= JuiceLevelsNumber; i++)
      {
         
         SetLevelValue(i,0.0);
         
      }
   }
}

//+------------------------------------------------------------------+
//| Moving Average of Oscillator                                     |
//+------------------------------------------------------------------+
int start()
{
//if ( Period != 15)  Alert ("Juice Is Recommended for 15 Min Chart only!!");
   int limit,i;
   int counted_bars=IndicatorCounted();
   static datetime lastPriceAlertedBar=0;
   int barToCheck;
   
//---- 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;
  
   SetLevelLines();
 
//---- main loop
   for(i=0; i<limit; i++)
   {
      Juice=iStdDev  (NULL,0,Periyod,MODE_EMA,0,PRICE_CLOSE,i);
      if(Juice>=thresholdLevelPoint){
         GoodJuice[i]=Juice/Point;
         BadJuice[i]=0;
         SoSoJuice[i]=0;
      }else if(Juice<sosoLevelPoint){
         BadJuice[i]=Juice/Point;
         GoodJuice[i]=0;
         SoSoJuice[i] = 0;
      }else{
         SoSoJuice[i] = Juice/Point;
         BadJuice[i]=0;
         GoodJuice[i]=0;
      }
   }
   
   if (DoAlerts)
   {
    //  if(last == 0 && Period() != 15) {Alert("Please note, Juice Alert only works with timeframe 15");last=1;}
    
      if (last !=Juice && Juice >= thresholdLevelPoint  && lastPriceAlertedBar != iTime(NULL,0,barToCheck))
      {
            Alert("Juice above ",thresholdLevel," for ", Symbol()," on ",Period());
            lastPriceAlertedBar = iTime(NULL,0,barToCheck);
            last=Juice;
      }
   }
      
//---- done
   return(0);
  }
//+------------------------------------------------------------------+

Comments