VoltyChoppy_v1_sounds_001

Download script
Author: Copyright � 2006, Forex-TSD.com
VoltyChoppy_v1_sounds_001

VoltyChoppy Logic Overview

The VoltyChoppy indicator is designed to help traders visualize and identify the current momentum, strength, and potential exhaustion of a market trend. Rather than simply showing if the price is going up or down, it categorizes the "quality" of the move into four distinct levels for both bullish (upward) and bearish (downward) directions.

Core Functionality

The script analyzes price action by comparing current closing prices against a dynamic volatility range (based on the Average True Range). It calculates four different sensitivity thresholds simultaneously. By varying these thresholds, the indicator can distinguish between a powerful, sustained trend and a weak, "choppy," or struggling market move.

Visual Categorization

The indicator uses a color-coded histogram system to display four specific market states:

Bullish (Upward) Trends:

  1. Strong UpTrend: Indicates high-momentum buying where the price is breaking through significant resistance levels.
  2. Retrace UpTrend: Signals a healthy pullback or consolidation within a larger upward move; the trend is still intact but taking a breath.
  3. Choppy UpTrend: Suggests the upward momentum is weakening and the market is beginning to lose its "drive."
  4. Ready to Change UpTrend: A warning state indicating that the bullish sentiment is exhausted and a reversal or significant slowdown is imminent.

Bearish (Downward) Trends:

  1. Strong DownTrend: Indicates aggressive selling pressure with high momentum.
  2. Retrace DownTrend: Signals a temporary bounce or recovery within a larger downward move.
  3. Choppy DownTrend: Suggests the selling pressure is drying up and the market is struggling to stay down.
  4. Ready to Change DownTrend: A warning state indicating that bearish momentum is fading and the price may soon reverse.

Key Features for Traders

  • Dynamic Volatility Adjustment: The indicator automatically adjusts its calculations based on current market volatility, ensuring that the "strength" levels remain relevant whether the market is moving fast or slow.
  • Audio Alerts: To keep traders informed without constantly watching the screen, the script includes an integrated audio notification system. It plays specific sounds whenever the market shifts between these different trend states (e.g., moving from a "Strong" trend to a "Choppy" one).
  • Trend State Memory: The logic tracks price boundaries to ensure that once a trend level is established, it remains consistent until the price action specifically breaks into a new category, preventing flickering signals.

In summary, VoltyChoppy acts as a sophisticated "mood ring" for the market, telling you not just where the price is going, but how much energy is left behind the move.

Indicators Used
Indicator of the average true range
Miscellaneous
Implements a curve of type %1It plays sound alerts
13 Views
0 Downloads
0 Favorites
VoltyChoppy_v1_sounds_001
//+------------------------------------------------------------------+
//|                                               VoltyChoppy_v1.mq4 |
//|                                  Copyright © 2006, Forex-TSD.com |
//|                         Written by IgorAD,igorad2003@yahoo.co.uk |   
//|            http://finance.groups.yahoo.com/group/TrendLaboratory |                                      
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Forex-TSD.com "
#property link      "http://www.forex-tsd.com/"

#property indicator_separate_window
#property indicator_minimum -0.05
#property indicator_maximum 1.05
#property indicator_buffers 8

//---- input parameters
extern int     Length      = 10;
extern double  Kv          = 4.0;
//extern double  Kd          = 1.1;
extern int     NumBars     = 1000; 
//---- buffers
double UpBuffer1[];
double UpBuffer2[];
double UpBuffer3[];
double UpBuffer4[];

double DnBuffer1[];
double DnBuffer2[];
double DnBuffer3[];
double DnBuffer4[];   
int play;
int lastplay;
string trend;
extern bool SoundON=true;
double alertTag;
double LastBar;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
  
//---- 
   SetIndexStyle(0,DRAW_HISTOGRAM,0,5,MediumBlue);
   SetIndexStyle(1,DRAW_HISTOGRAM,0,5,DodgerBlue);
   SetIndexStyle(2,DRAW_HISTOGRAM,0,5,LightBlue);
   SetIndexStyle(3,DRAW_HISTOGRAM,0,5,Aqua);
   
   SetIndexStyle(4,DRAW_HISTOGRAM,0,5,Crimson);
   SetIndexStyle(5,DRAW_HISTOGRAM,0,5,Tomato);
   SetIndexStyle(6,DRAW_HISTOGRAM,0,5,Orange);
   SetIndexStyle(7,DRAW_HISTOGRAM,0,5,Yellow);
   
   SetIndexBuffer(0,UpBuffer1);
   SetIndexBuffer(1,UpBuffer2);
   SetIndexBuffer(2,UpBuffer3);
   SetIndexBuffer(3,UpBuffer4);
   
   SetIndexBuffer(4,DnBuffer1);
   SetIndexBuffer(5,DnBuffer2);
   SetIndexBuffer(6,DnBuffer3);
   SetIndexBuffer(7,DnBuffer4);
   
//---- 
   string short_name="VoltyChoppy";
   IndicatorShortName(short_name);
   SetIndexLabel(0,"Strong UpTrend");
   SetIndexLabel(1,"Retrace UpTrend");   
   SetIndexLabel(2,"Choppy UpTrend");
   SetIndexLabel(3,"Be ready to change UpTrend");
   
   SetIndexLabel(4,"Strong DownTrend");
   SetIndexLabel(5,"Retrace DownTrend");   
   SetIndexLabel(6,"Choppy DownTrend");
   SetIndexLabel(7,"Be ready to change DownTrend"); 
//----
   
   SetIndexDrawBegin(0,Length);
   SetIndexDrawBegin(1,Length);
   SetIndexDrawBegin(2,Length);
   SetIndexDrawBegin(3,Length);
   SetIndexDrawBegin(4,Length);
   SetIndexDrawBegin(5,Length);
   SetIndexDrawBegin(6,Length);
   SetIndexDrawBegin(7,Length);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| VoltyChoppy_v1                                                  |
//+------------------------------------------------------------------+
int start()
  {
   double smin,smax,smin1,smax1,
          rmin,rmax,rmin1,rmax1,
          cmin,cmax,cmin1,cmax1,
          bmin,bmax,bmin1,bmax1;
   int    i, strend, rtrend, ctrend, btrend;       
      
//----
   if(NumBars<=Length) return(0);
//---- initial zero
      for(i=Bars;i>=0;i--) 
      {
      UpBuffer1[i]=0.0;
      UpBuffer2[i]=0.0;
      UpBuffer3[i]=0.0;
      UpBuffer4[i]=0.0;
      
      DnBuffer1[i]=0.0;
      DnBuffer2[i]=0.0;
      DnBuffer3[i]=0.0;
      DnBuffer4[i]=0.0;
      }
//----
   double Kd = MathPow(Kv,1.0/3.0); 
  
   for(i=NumBars - Length -1;i>=0;i--) 
   {	 
   smin  = Close[i] - Kv*iATR(NULL,0,Length,i);
   smax  = Close[i] + Kv*iATR(NULL,0,Length,i);
   
   rmin  = Close[i] - Kv*iATR(NULL,0,Length,i)/Kd;
   rmax  = Close[i] + Kv*iATR(NULL,0,Length,i)/Kd;
   
   cmin  = Close[i] - Kv*iATR(NULL,0,Length,i)/(Kd*Kd);
   cmax  = Close[i] + Kv*iATR(NULL,0,Length,i)/(Kd*Kd);
   
   bmin  = Close[i] - Kv*iATR(NULL,0,Length,i)/(Kd*Kd*Kd);
   bmax  = Close[i] + Kv*iATR(NULL,0,Length,i)/(Kd*Kd*Kd);
   
   if ( Close[i] > smax1 ) strend = 1;
   if ( Close[i] < smin1 ) strend =-1;
   
   if ( strend > 0 && smin < smin1 ) smin = smin1;
   if ( strend < 0 && smax > smax1 ) smax = smax1;
     
   if ( Close[i] > rmax1 ) rtrend = 1;
   if ( Close[i] < rmin1 ) rtrend =-1; 
   
   if ( rtrend > 0 && rmin < rmin1 ) rmin = rmin1;
   if ( rtrend < 0 && rmax > rmax1 ) rmax = rmax1;
   
   
   if ( Close[i] > cmax1 ) ctrend = 1; 
   if ( Close[i] < cmin1 ) ctrend =-1;
   
   if ( ctrend > 0 && cmin < cmin1 ) cmin = cmin1;
   if ( ctrend < 0 && cmax > cmax1 ) cmax = cmax1;
   
   if ( Close[i] > bmax1 ) btrend = 1; 
   if ( Close[i] < bmin1 ) btrend =-1; 
   
   if ( btrend > 0 && bmin < bmin1 ) bmin = bmin1;
   if ( btrend < 0 && bmax > bmax1 ) bmax = bmax1;

   if ( strend  > 0 )
   {
    UpBuffer1[i] = 1.0;trend="photonup.wav";play=1;UpBuffer2[i] = 0.0;UpBuffer3[i] = 0.0;UpBuffer4[i] = 0.0;
    DnBuffer1[i] = 0.0;DnBuffer2[i] = 0.0;DnBuffer3[i] = 0.0;DnBuffer4[i] = 0.0;
      
   if ( btrend < 0 )
   {UpBuffer1[i] = 0.0;UpBuffer2[i] = 1.0;trend="blip.wav";play=2;UpBuffer3[i] = 0.0;UpBuffer4[i] = 0.0;
    DnBuffer1[i] = 0.0;DnBuffer2[i] = 0.0;DnBuffer3[i] = 0.0;DnBuffer4[i] = 0.0;}
   
   if ( ctrend < 0 )
   {UpBuffer1[i] = 0.0;UpBuffer2[i] = 0.0;UpBuffer3[i] = 1.0;trend="blip2.wav";play=3;UpBuffer4[i] = 0.0;
    DnBuffer1[i] = 0.0;DnBuffer2[i] = 0.0;DnBuffer3[i] = 0.0;DnBuffer4[i] = 0.0;}
    
   if ( rtrend < 0 )
   {UpBuffer1[i] = 0.0;UpBuffer2[i] = 0.0;UpBuffer3[i] = 0.0;UpBuffer4[i] = 1.0;trend="relocate.wav";play=4;
    DnBuffer1[i] = 0.0;DnBuffer2[i] = 0.0;DnBuffer3[i] = 0.0;DnBuffer4[i] = 0.0;}
   }
 
   if ( strend < 0 ) 
   {
    UpBuffer1[i] = 0.0;UpBuffer2[i] = 0.0;UpBuffer3[i] = 0.0;UpBuffer4[i] = 0.0;
    DnBuffer1[i] = 1.0;trend="photondown.wav";play=5;DnBuffer2[i] = 0.0;DnBuffer3[i] = 0.0;DnBuffer4[i] = 0.0;
   
   if ( btrend > 0 )    
   {UpBuffer1[i] = 0.0;UpBuffer2[i] = 0.0;UpBuffer3[i] = 0.0;UpBuffer4[i] = 0.0;
    DnBuffer1[i] = 0.0;DnBuffer2[i] = 1.0;trend="throw_disk.wav";play=6;DnBuffer3[i] = 0.0;DnBuffer4[i] = 0.0;}
   
   if ( ctrend > 0 )  
   {UpBuffer1[i] = 0.0;UpBuffer2[i] = 0.0;UpBuffer3[i] = 0.0;UpBuffer4[i] = 0.0;
    DnBuffer1[i] = 0.0;DnBuffer2[i] = 0.0;DnBuffer3[i] = 1.0;trend="pluck.wav";play=7;DnBuffer4[i] = 0.0;}
      
   if ( rtrend > 0 )
   {UpBuffer1[i] = 0.0;UpBuffer2[i] = 0.0;UpBuffer3[i] = 0.0;UpBuffer4[i] = 0.0;
    DnBuffer1[i] = 0.0;DnBuffer2[i] = 0.0;DnBuffer3[i] = 0.0;DnBuffer4[i] = 1.0;trend="sparcle.wav";play=8;}
   }

   smin1 = smin; smax1 = smax;
   rmin1 = rmin; rmax1 = rmax;
   cmin1 = cmin; cmax1 = cmax;
   bmin1 = bmin; bmax1 = bmax;
 
   }
    if (play==0)
    {
    play=lastplay;
    }
    if (SoundON==true && play != lastplay && Bars>LastBar)
    {
    PlaySound(trend);
     lastplay=play;
     LastBar=Bars;
     } 
//----
   return(0);
 
  }
//+------------------------------------------------------------------+

Comments