Pompideu (Ci below vol bracket)

My idea for the day is utilizing the spike below the volatility bracket of the 7-sample consolidation indicator for a well determined entry point to start defying a move.

It is so simple, that it is almost elegant. You would need to have it as the first indicator below to have the plots show right.

#property copyright "Copyright © 2009, David Moser, Copyright © 2019, Macdulio"
#property link      "https://forexfore.blog"
#property description "Choppiness indicator with daily reversal signals"

// This Indicator is NEVER to be SOLD individually 
// This Indicator is NEVER to be INCLUDED as part of a collection that is SOLD

//---- common control defaults
#property indicator_separate_window
#property indicator_minimum 24
#property indicator_maximum 64
#property indicator_buffers 3
#property indicator_color1 Cyan
#property indicator_color2 Yellow
#property indicator_color3 Crimson
#property indicator_width1 3
#property indicator_style1 0
#property indicator_color2 Navy
#property indicator_width2 1
#property indicator_style2 0
#property indicator_color3 Navy
#property indicator_width3 1
#property indicator_style3 0
#property indicator_level1  34
#property indicator_level2  53
#property indicator_levelstyle 2
#property indicator_levelcolor Maroon
 
//---- indicator parameters
// Main Parameters
extern int ChoppinessPeriod=7;        // Number of bars to evaluation CI
extern int SmoothingPeriod=1;          // Number of bars to apply SMA
extern int StdDevPeriod=7;            // Number of bars to evaluate Standard Deviation of the CI
extern bool StdDevFollowPrice=false;   // True, StdDev bars follow price, False, StdDev bars centered on 50
extern bool EnableAlertOnHigh=false;   // Alert setting for entering time of choppiness
extern double AlertHighVal=62;       // Default value based on fib numbers
extern bool EnableAlertOnLow=false;    // Alert setting for entering time of trending
extern double AlertLowVal=34;        // Default value based on fib numbers
extern int MaxCalcBars=100;           // Limit calculations back this many bars
extern bool plot_reminders = false;
//---- indicator buffers
double ExtMapBuffer[];
double CI[];
double StdDevHiBuffer[];
double StdDevLoBuffer[];
double IntMapBuffer[];
double IntStdDevBuffer[];
extern bool plot_CI_divergences = true;
//---- variables
string symbol = Symbol();
string TimeFrame;
datetime LastAlert=0;
datetime LowFractalTime_1, LowFractalTime_2;
datetime UpFractalTime_1, UpFractalTime_2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
 
   IndicatorBuffers(5);
   SetIndexStyle(0,DRAW_LINE,EMPTY,5);
   SetIndexBuffer(0,ExtMapBuffer);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,StdDevHiBuffer);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,StdDevLoBuffer);
   SetIndexBuffer(3,IntMapBuffer);
   SetIndexBuffer(4,IntStdDevBuffer);
   
   if (ChoppinessPeriod<2) ChoppinessPeriod = 2;   // Any lower and this indicator isn't relevant
   if (SmoothingPeriod<1) SmoothingPeriod = 1;     // Avoid configuration errors
   if (StdDevPeriod<2) StdDevPeriod = 2;           // Any lower and the Standard Deviation isn't relevant
   if (MaxCalcBars>10000) MaxCalcBars = 10000;     // Any higher and may adversely affect performance on multi-chart setups
   
   SetIndexDrawBegin(0,ChoppinessPeriod+SmoothingPeriod);
   SetIndexDrawBegin(1,ChoppinessPeriod+SmoothingPeriod+StdDevPeriod);
   SetIndexDrawBegin(2,ChoppinessPeriod+SmoothingPeriod+StdDevPeriod);
   
   string short_name="Choppiness Index ("+ChoppinessPeriod+","+SmoothingPeriod+","+StdDevPeriod+")";
   IndicatorShortName(short_name);

   switch (Period())
     {
     case     1: TimeFrame = "M1";  break;
     case     5: TimeFrame = "M5";  break;
     case    15: TimeFrame = "M15"; break;
     case    30: TimeFrame = "M30"; break;
     case    60: TimeFrame = "H1";  break;
     case   240: TimeFrame = "H4";  break;
     case  1440: TimeFrame = "D1";  break;
     case 10080: TimeFrame = "W1";  break;
     case 43200: TimeFrame = "MN";  break;
   }

//---- initial zero
   for(int i=0;i<=Bars;i++) ExtMapBuffer[i]=0;  // Smoothed & visible main indicator line
   for(i=0;i<=Bars;i++) StdDevHiBuffer[i]=0;    // Upper StdDev band, visible
   for(i=0;i<=Bars;i++) StdDevLoBuffer[i]=0;    // Lower StdDev band, visible
   for(i=0;i<=Bars;i++) IntMapBuffer[i]=0;      // Raw CI, not smoothed, not visible
   for(i=0;i<=Bars;i++) IntStdDevBuffer[i]=0;   // Raw StdDev of Smoothed & visible main indicator line (ExtMapBuffer)

   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
  ArrayResize(CI, Bars);
  ArrayInitialize(CI, EMPTY_VALUE); 
  int counted_bars=IndicatorCounted();
  int i, i2,j2, z,limit;
  double bufferTemp1, bufferTemp2;

  if (counted_bars<0) return(-1); 
  if (counted_bars>0) counted_bars--; 
  limit=Bars-counted_bars;
  if (limit>MaxCalcBars) limit=MaxCalcBars;
  
  for (i=limit-1; i>=0; i--) 
    {
    IntMapBuffer[i] = ChoppinessIndex(ChoppinessPeriod,i);
    bufferTemp1 = 0;
    for(int j=0; j<SmoothingPeriod; j++) { z=i+j; bufferTemp1 += IntMapBuffer[z]; }
    ExtMapBuffer[i] = bufferTemp1 / SmoothingPeriod;
    IntStdDevBuffer[i] = StdDev(i,StdDevPeriod);
    bufferTemp1 = 0;
    bufferTemp2 = 0;
    for(int n=0; n<StdDevPeriod; n++)
      {
      z=i+n;
      if (StdDevFollowPrice)
        {
        bufferTemp1 += ExtMapBuffer[z];
        bufferTemp2 += ExtMapBuffer[z];
        }
      else
        {
        bufferTemp1 += 50;
        bufferTemp2 += 50;
        }
      bufferTemp1 += IntStdDevBuffer[i]*2;
      bufferTemp2 -= IntStdDevBuffer[i]*2;
      }
    StdDevHiBuffer[i] = bufferTemp1 / StdDevPeriod;
    StdDevLoBuffer[i] = bufferTemp2 / StdDevPeriod;
    }

    if (EnableAlertOnHigh)
      if (LastAlert != Time[0])
        if ((ExtMapBuffer[1]>AlertHighVal) && (ExtMapBuffer[2]<AlertHighVal))
          {
          LastAlert = Time[0]; // No more alerts on the current bar
          Alert(Symbol()+","+TimeFrame+":Choppiness greater than "+DoubleToStr(AlertHighVal,1));
          }
    
    if (EnableAlertOnLow)
      if (LastAlert != Time[0])
        if ((ExtMapBuffer[1]<AlertLowVal) && (ExtMapBuffer[2]>AlertLowVal))
          {
          LastAlert = Time[0]; // No more alerts on the current bar
          Alert(Symbol()+","+TimeFrame+":Choppiness less than "+DoubleToStr(AlertLowVal,1));
          }

  for (i = 310 ; i >= 0; i--) 
      CI[i]=ChoppinessIndex(7,i);


deletetxt1("Take");

deletetxt1("Push");

 if ( Period()==30 && (
   (ChoppinessIndex240(7,1)>53 && ChoppinessIndex240(7,0)<53)
  || (ChoppinessIndex240(7,2)>53 && ChoppinessIndex240(7,1)<53)
  || (ChoppinessIndex240(7,3)>53 && ChoppinessIndex240(7,2)<53)
   || (ChoppinessIndex240(7,4)>53 && ChoppinessIndex240(7,3)<53)
   || (ChoppinessIndex240(7,5)>53 && ChoppinessIndex240(7,4)<53)
    || (ChoppinessIndex240(7,6)>53 && ChoppinessIndex240(7,5)<53)
     || (ChoppinessIndex240(7,7)>53 && ChoppinessIndex240(7,6)<53)
  )){
 ObjectCreate("Takeni",OBJ_TEXT, 1, Time[14], 64);
                 ObjectSetText("Takeni", "4H in Push - Do not close Hedge until ", 23, "Arial Black", clrWhite);

 ObjectCreate("Pushi",OBJ_TEXT, 1, Time[14], 54);
                 ObjectSetText("Pushi", "Red Tail New Low/High and CI4H<36", 23, "Arial Black", clrPurple);
}

if (plot_reminders){
   ObjectCreate("Taken",OBJ_TEXT, 1, Time[14], 64);
                 ObjectSetText("Taken", "Take a position", 33, "Arial Black", clrWhite);

 ObjectCreate("Push",OBJ_TEXT, 1, Time[14], 54);
                 ObjectSetText("Push", "Push Against OB/OS Line", 23, "Arial Black", clrMoccasin);}
                 

i=1;

deletetxt1("HLLN");

while (i<100 && !(ChoppinessIndexD(7,i)<38 && ChoppinessIndexD(7,i+1)>38 && iLow(symbol,1440,i+1)>iLow(symbol,1440,i+2) && iLow(symbol,1440,i+2)>iLow(symbol,1440,i+3) && iLow(symbol,1440,i+3)>iLow(symbol,1440,i+4)))
   i++;
   
if (ChoppinessIndexD(7,i)<38 && ChoppinessIndexD(7,i+1)>38 && iLow(symbol,1440,i+1)>iLow(symbol,1440,i+2) && iLow(symbol,1440,i+2)>iLow(symbol,1440,i+3) && iLow(symbol,1440,i+3)>iLow(symbol,1440,i+4) && i<100)   {
               
               
               ObjectCreate( "HLLN"+IntegerToString(i), OBJ_HLINE, 0, Time[0], iHigh(symbol,1440,iHighest(symbol,1440,MODE_HIGH,6,i-1)) );
               ObjectSet("HLLN"+IntegerToString(i), OBJPROP_COLOR, clrWhite );
               ObjectSet("HLLN"+IntegerToString(i), OBJPROP_STYLE, 4 );
               
               
               for (j=1; j<=7; j++) {
               
               ObjectCreate( "HLLNj"+IntegerToString(j), OBJ_HLINE, 0, Time[0],  iHigh(symbol,1440,iHighest(symbol,1440,MODE_HIGH,6,i-1))-160*j*Point );
               ObjectSet("HLLNj"+IntegerToString(j), OBJPROP_COLOR, clrWhite );
               ObjectSet("HLLNj"+IntegerToString(j), OBJPROP_STYLE, 4 );
               }
               
               
                 for (j=1; j<=6; j++) {
               
               ObjectCreate( "HLLNjj"+IntegerToString(j), OBJ_HLINE, 0, Time[0],  iHigh(symbol,1440,iHighest(symbol,1440,MODE_HIGH,6,i-1))+160*j*Point );
               ObjectSet("HLLNjj"+IntegerToString(j), OBJPROP_COLOR, clrPink );
               ObjectSet("HLLNjj"+IntegerToString(j), OBJPROP_STYLE, 4 );
               }
           
               
               }     

i=1;               

while (i<100 && !(ChoppinessIndexD(7,i)<38 && ChoppinessIndexD(7,i+1)>38 && iLow(symbol,1440,i+1)<iLow(symbol,1440,i+2) && iLow(symbol,1440,i+2)<iLow(symbol,1440,i+3) && iLow(symbol,1440,i+3)<iLow(symbol,1440,i+4)))
   i++;


if (ChoppinessIndexD(7,i)<38 && ChoppinessIndexD(7,i+1)>38 && iLow(symbol,1440,i+1)<iLow(symbol,1440,i+2) && iLow(symbol,1440,i+2)<iLow(symbol,1440,i+3) && iLow(symbol,1440,i+3)<iLow(symbol,1440,i+4) && i<100)   {
               
               
               ObjectCreate( "HLLNx"+IntegerToString(i), OBJ_HLINE, 0, Time[0], iLow(symbol,1440,iLowest(symbol,1440,MODE_LOW,6,i-1)) );
               ObjectSet("HLLNx"+IntegerToString(i), OBJPROP_COLOR, clrYellow );
               ObjectSet("HLLNx"+IntegerToString(i), OBJPROP_STYLE, 4 );
               
               
               for (j=1; j<=7; j++) {
               
               ObjectCreate( "HLLNjx"+IntegerToString(j), OBJ_HLINE, 0, Time[0],  iLow(symbol,1440,iLowest(symbol,1440,MODE_LOW,6,i-1))+160*j*Point );
               ObjectSet("HLLNjx"+IntegerToString(j), OBJPROP_COLOR, clrYellow );
               ObjectSet("HLLNjx"+IntegerToString(j), OBJPROP_STYLE, 4 );
               }
               
               
                  for (j=1; j<=6; j++) {
               
               ObjectCreate( "HLLNjxx"+IntegerToString(j), OBJ_HLINE, 0, Time[0],  iLow(symbol,1440,iLowest(symbol,1440,MODE_LOW,6,i-1))-160*j*Point );
               ObjectSet("HLLNjxx"+IntegerToString(j), OBJPROP_COLOR, clrOrange );
               ObjectSet("HLLNjxx"+IntegerToString(j), OBJPROP_STYLE, 4 );
               }
               
           
               
               }     
                           
                 

deletetxt1("bNNN");

if (plot_CI_divergences){ 

i2=1;
   while (i2<300 ){
    i=i2+2; 
      if (Low[i2]<Low[i2+2] && Low[i2+2]<Low[i2+3] && CI[i2]<CI[i2+1] && CI[i2-1]>CI[i2] && CI[i2]<45) 
         while (i<i2+30){
               if (CI[i2]>CI[i] && CI[i]<CI[i-1] && CI[i]<CI[i+1] && CI[i]<33 && Low[i]<Low[i+1] && Low[i+1]<Low[i+2] && Low[i2]<Low[i2+2] && Low[i2+2]<Low[i2+3] && CI[i2]<CI[i2+1] && CI[i2-1]>CI[i2] && CI[i2]<45 ) break;
      i++;}
    if (CI[i2]>CI[i] && CI[i]<CI[i-1] && CI[i]<CI[i+1] && CI[i]<33 && Low[i]<Low[i+1] && Low[i+1]<Low[i+2] && Low[i2]<Low[i2+1] && Low[i2+2]<Low[i2+3] && CI[i2]<CI[i2+1] && CI[i2-1]>CI[i2] && CI[i2]<45 ) break;
     i2++;}  


if (i2<300 &&  High[i]>High[i+2] && High[i+2]>High[i+3] ) {UpFractalTime_2=iTime(NULL, 0,i2);    UpFractalTime_1=iTime(NULL, 0,i);    }


 if (i<300 && i<i2+30)   {ObjectDelete(0,"bNNN3_2");
     ObjectCreate(0,"bNNNm3_2",OBJ_TREND,1,UpFractalTime_1,CI[i],UpFractalTime_2,CI[i2]);
    ObjectSetInteger(0,"bNNNm3_2",OBJPROP_RAY_RIGHT,false);
         ObjectSet("bNNNm3_2",OBJPROP_COLOR,indicator_color3);
         ObjectSet("bNNNm3_2",OBJPROP_WIDTH,8); 
         ObjectSet("bNNNm3_2",OBJPROP_BACK,1); }



j2=1;
   while (j2<300 ){
    j=j2+2; 
      if (Low[j2]<Low[j2+2] && Low[j2+2]<Low[j2+3] && CI[j2]<CI[j2+1] && CI[j2-1]>CI[j2] && CI[j2]<45) 
         while (j<j2+30){
               if (CI[j2]>CI[j] && CI[j]<CI[j-1] && CI[j]<CI[j+1] && CI[j]<33 && Low[j]<Low[j+1] && Low[j+1]<Low[j+2] && Low[j2]<Low[j2+2] && Low[j2+2]<Low[j2+3] && CI[j2]<CI[j2+1] && CI[j2-1]>CI[j2] && CI[j2]<45 ) break;
      j++;}
    if (CI[j2]>CI[j] && CI[j]<CI[j-1] && CI[j]<CI[j+1] && CI[j]<33 && Low[j]<Low[j+1] && Low[j+1]<Low[j+2] && Low[j2]<Low[j2+2] && Low[j2+2]<Low[j2+3] && CI[j2]<CI[j2+1] && CI[j2-1]>CI[j2] && CI[j2]<45 ) break;
     j2++;}  


if (j2<300 &&  Low[j]<Low[j+2] && Low[j+2]<Low[j+3] ) {LowFractalTime_2=iTime(NULL, 0,j2);    LowFractalTime_1=iTime(NULL, 0,j);    }


 if (j<300 && j<j2+30)   {ObjectDelete(0,"bNNN3_2");
     ObjectCreate(0,"bNNN3_2",OBJ_TREND,1,LowFractalTime_1,CI[j],LowFractalTime_2,CI[j2]);
    ObjectSetInteger(0,"bNNN3_2",OBJPROP_RAY_RIGHT,false);
         ObjectSet("bNNN3_2",OBJPROP_COLOR,indicator_color2);
         ObjectSet("bNNN3_2",OBJPROP_WIDTH,8); 
         ObjectSet("bNNN3_2",OBJPROP_BACK,1); }
         
         
int keepj2 = j2;         


j2=keepj2+30;
   while (j2<300 ){
    j=j2+2; 
      if (Low[j2]<Low[j2+2] && Low[j2+2]<Low[j2+3] && CI[j2]<CI[j2+1] && CI[j2-1]>CI[j2] && CI[j2]<45) 
         while (j<j2+30){
               if (CI[j2]>CI[j] && CI[j]<CI[j-1] && CI[j]<CI[j+1] && CI[j]<33 && Low[j]<Low[j+1] && Low[j+1]<Low[j+2] && Low[j2]<Low[j2+2] && Low[j2+2]<Low[j2+3] && CI[j2]<CI[j2+1] && CI[j2-1]>CI[j2] && CI[j2]<45 ) break;
      j++;}
    if (CI[j2]>CI[j] && CI[j]<CI[j-1] && CI[j]<CI[j+1] && CI[j]<33 && Low[j]<Low[j+1] && Low[j+1]<Low[j+2] && Low[j2]<Low[j2+2] && Low[j2+2]<Low[j2+3] && CI[j2]<CI[j2+1] && CI[j2-1]>CI[j2] && CI[j2]<45 ) break;
     j2++;}  


if (j2<300 &&  Low[j]<Low[j+1] && Low[j+1]<Low[j+2] ) {LowFractalTime_2=iTime(NULL, 0,j2);    LowFractalTime_1=iTime(NULL, 0,j);    }


 if (j<300 && j<j2+30)   {ObjectDelete(0,"bNNN3_3");
     ObjectCreate(0,"bNNN3_3",OBJ_TREND,1,LowFractalTime_1,CI[j],LowFractalTime_2,CI[j2]);
    ObjectSetInteger(0,"bNNN3_3",OBJPROP_RAY_RIGHT,false);
         ObjectSet("bNNN3_3",OBJPROP_COLOR,indicator_color2);
         ObjectSet("bNNN3_3",OBJPROP_WIDTH,8); 
         ObjectSet("bNNN3_3",OBJPROP_BACK,1); }
       
       
keepj2 = j2;         


j2=keepj2+30;
   while (j2<300 ){
    j=j2+2; 
      if (Low[j2]<Low[j2+2] && Low[j2+2]<Low[j2+3] && CI[j2]<CI[j2+1] && CI[j2-1]>CI[j2] && CI[j2]<45) 
         while (j<j2+32){
               if (CI[j2]>CI[j] && CI[j]<CI[j-1] && CI[j]<CI[j+1] && CI[j]<33 && Low[j]<Low[j+1] && Low[j+1]<Low[j+2] && Low[j2]<Low[j2+2] && Low[j2+2]<Low[j2+3] && CI[j2]<CI[j2+1] && CI[j2-1]>CI[j2] && CI[j2]<45 ) break;
      j++;}
    if (CI[j2]>CI[j] && CI[j]<CI[j-1] && CI[j]<CI[j+1] && CI[j]<33 && Low[j]<Low[j+1] && Low[j+1]<Low[j+2] && Low[j2]<Low[j2+2] && Low[j2+2]<Low[j2+3] && CI[j2]<CI[j2+1] && CI[j2-1]>CI[j2] && CI[j2]<45 ) break;
     j2++;}  


if (j2<300 &&  Low[j]<Low[j+1] && Low[j+1]<Low[j+2] ) {LowFractalTime_2=iTime(NULL, 0,j2);    LowFractalTime_1=iTime(NULL, 0,j);    }


 if (j<300 && j<j2+32)   {ObjectDelete(0,"bNNN3_4");
     ObjectCreate(0,"bNNN3_4",OBJ_TREND,1,LowFractalTime_1,CI[j],LowFractalTime_2,CI[j2]);
    ObjectSetInteger(0,"bNNN3_4",OBJPROP_RAY_RIGHT,false);
         ObjectSet("bNNN3_4",OBJPROP_COLOR,indicator_color2);
         ObjectSet("bNNN3_4",OBJPROP_WIDTH,8); 
         ObjectSet("bNNN3_4",OBJPROP_BACK,1); }
         


}

deletetxt1("hOPITAL");

if (Period()==1440){
for(i=200; i>=1; i--){
   if (ExtMapBuffer[i]<StdDevLoBuffer[i] && ExtMapBuffer[i+1]>StdDevLoBuffer[i+1]){
      if (MathAbs(Close[i+1]-iLow(NULL,0,iLowest(NULL,0,MODE_LOW,3,i)))<MathAbs(Close[i+1]-iHigh(NULL,0,iHighest(NULL,0,MODE_HIGH,3,i))) )
         {ObjectCreate("hOPITAL"+IntegerToString(i), OBJ_TEXT, 1, Time[i+2], 60);  
                ObjectSetText("hOPITAL"+IntegerToString(i), "Buy Below:", 10, "Arial Black",  clrNavy);
                ObjectCreate("hOPITALl"+IntegerToString(i), OBJ_TEXT, 1, Time[i+2], 40);  
                ObjectSetText("hOPITALl"+IntegerToString(i), NormalizeDouble(iLow(NULL,0,iLowest(NULL,0,MODE_LOW,2,i)),4), 16, "Arial Black",  clrNavy);
         }
          if (MathAbs(Close[i+1]-iLow(NULL,0,iLowest(NULL,0,MODE_LOW,3,i)))>MathAbs(Close[i+1]-iHigh(NULL,0,iHighest(NULL,0,MODE_HIGH,3,i))) )
         {ObjectCreate("hOPITAL"+IntegerToString(i), OBJ_TEXT, 1, Time[i+2], 60);  
                ObjectSetText("hOPITAL"+IntegerToString(i), "Sell Above:", 10, "Arial Black",  clrNavy);
                ObjectCreate("hOPITALl"+IntegerToString(i), OBJ_TEXT, 1, Time[i+2], 40);  
                ObjectSetText("hOPITALl"+IntegerToString(i), NormalizeDouble(iHigh(NULL,0,iHighest(NULL,0,MODE_HIGH,2,i)),4), 16, "Arial Black",  clrNavy);
         }
   }}

}


  return(0);
  }
  
  
double ChoppinessIndex(int period, int bar)
  {
    double Low0 = 0, High0 = 0, Close1 = 0;
    double TrueRangeLow = 0, TrueRangeHigh = 0, TrueRangeSum = 0, Input = 0;
    double PeriodTrueRangeLow = 999999999, PeriodTrueRangeHigh = 0, PeriodTrueRange = 0;

    for(int k=bar; k<bar+period; k++)
    {
      Low0   = iLow(NULL,0,k);
      High0  = iHigh(NULL,0,k);
      Close1 = iClose(NULL,0,k+1);

      if (Low0<Close1)  TrueRangeLow  = Low0;  else TrueRangeLow  = Close1;
      if (High0>Close1) TrueRangeHigh = High0; else TrueRangeHigh = Close1;
      
      if (TrueRangeLow <PeriodTrueRangeLow)  PeriodTrueRangeLow  = TrueRangeLow;  // find true low of period
      if (TrueRangeHigh>PeriodTrueRangeHigh) PeriodTrueRangeHigh = TrueRangeHigh; // find true high of period

      TrueRangeSum += TrueRangeHigh;
      TrueRangeSum -= TrueRangeLow;
    }

    PeriodTrueRange = PeriodTrueRangeHigh - PeriodTrueRangeLow;
    if (PeriodTrueRange==0) PeriodTrueRange = MathPow(10, -12); // avoid possibility of division by zero
    Input = TrueRangeSum / PeriodTrueRange;
    return ((logN(Input, 10, MathPow(10, -12)) / logN(period, 10, MathPow(10, -12))) * 100);
  }


double ChoppinessIndexD(int period, int bar)
  {
    double Low0 = 0, High0 = 0, Close1 = 0;
    double TrueRangeLow = 0, TrueRangeHigh = 0, TrueRangeSum = 0, Input = 0;
    double PeriodTrueRangeLow = 999999999, PeriodTrueRangeHigh = 0, PeriodTrueRange = 0;

    for(int k=bar; k<bar+period; k++)
    {
      Low0   = iLow(NULL,1440,k);
      High0  = iHigh(NULL,1440,k);
      Close1 = iClose(NULL,1440,k+1);

      if (Low0<Close1)  TrueRangeLow  = Low0;  else TrueRangeLow  = Close1;
      if (High0>Close1) TrueRangeHigh = High0; else TrueRangeHigh = Close1;
      
      if (TrueRangeLow <PeriodTrueRangeLow)  PeriodTrueRangeLow  = TrueRangeLow;  // find true low of period
      if (TrueRangeHigh>PeriodTrueRangeHigh) PeriodTrueRangeHigh = TrueRangeHigh; // find true high of period

      TrueRangeSum += TrueRangeHigh;
      TrueRangeSum -= TrueRangeLow;
    }

    PeriodTrueRange = PeriodTrueRangeHigh - PeriodTrueRangeLow;
    if (PeriodTrueRange==0) PeriodTrueRange = MathPow(10, -12); // avoid possibility of division by zero
    Input = TrueRangeSum / PeriodTrueRange;
    return ((logN(Input, 10, MathPow(10, -12)) / logN(period, 10, MathPow(10, -12))) * 100);
  }


double ChoppinessIndex240(int period, int bar)
  {
    double Low0 = 0, High0 = 0, Close1 = 0;
    double TrueRangeLow = 0, TrueRangeHigh = 0, TrueRangeSum = 0, Input = 0;
    double PeriodTrueRangeLow = 999999999, PeriodTrueRangeHigh = 0, PeriodTrueRange = 0;

    for(int k=bar; k<bar+period; k++)
    {
      Low0   = iLow(NULL,240,k);
      High0  = iHigh(NULL,240,k);
      Close1 = iClose(NULL,240,k+1);

      if (Low0<Close1)  TrueRangeLow  = Low0;  else TrueRangeLow  = Close1;
      if (High0>Close1) TrueRangeHigh = High0; else TrueRangeHigh = Close1;
      
      if (TrueRangeLow <PeriodTrueRangeLow)  PeriodTrueRangeLow  = TrueRangeLow;  // find true low of period
      if (TrueRangeHigh>PeriodTrueRangeHigh) PeriodTrueRangeHigh = TrueRangeHigh; // find true high of period

      TrueRangeSum += TrueRangeHigh;
      TrueRangeSum -= TrueRangeLow;
    }

    PeriodTrueRange = PeriodTrueRangeHigh - PeriodTrueRangeLow;
    if (PeriodTrueRange==0) PeriodTrueRange = MathPow(10, -12); // avoid possibility of division by zero
    Input = TrueRangeSum / PeriodTrueRange;
    return ((logN(Input, 10, MathPow(10, -12)) / logN(period, 10, MathPow(10, -12))) * 100);
  }  

double logN(double x, double base, double epsilon)
  {
    double integer = 0.0;
    if ((x < 1) || (base < 1)) return(0);

    while (x < 1)
    {
      integer -= 1;
      x *= base;
    }
  
    while (x >= base)
    {
      integer += 1;
      x /= base;
    }
  
    double partial = 0.5;
    x *= x;
    double decimal = 0.0;

    while (partial > epsilon)
    {
      if (x >= base)
      {
        decimal += partial;
        x = x / base;
      }
      partial *= 0.5;
      x *= x;
    }
    
    return (integer + decimal);
  } 


double StdDev(int shift, int samples)
  {
  double x0=0, x1=0, x2=0;
  for (int m=0; m<samples; m++)
    {
    x0 = ExtMapBuffer[m+shift];
    x1 += x0;
    x2 += MathPow(x0,2);
    }
  return(MathSqrt((x2-(x1*x1/samples))/(samples-1))); // minimum samples is 2, enforced in the init section
  }
  
    void deletetxt1(string text){
   for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){
      string   on = ObjectName(iObj);
      if(StringFind(on, text) == 0)  ObjectDelete(on);
}  }

From 0 to 100, 100, 100

Once a bona fide turn has taken place, all you have to do is accelerate three times. Or decelerate, depending on the direction.

From 100 to 0, 0, 0

#property copyright "Copyright © 2019, Macdulio" 
#property link      "https://forexfore.blog" 
#property description "V1.0"
#property description "LEMA 30N RF Zero to 100"
#property description "All the moving average pairs"
#property description "you will ever need for trading."
#property description "For further information turn to"
#property description "my blog or my book,"
#property description "Computer Aided Trading"
#property strict;
#property indicator_chart_window
#property indicator_buffers 34
#property indicator_color1 Crimson
#property indicator_color2 Blue
#define  NL    "\n"
extern int lookback = 500;
extern double zero = 6.0;
extern double hundred = 94.0;
extern double FSize=32;
extern bool plot_Spark_Sones = true;
extern bool plot_polarities = true;
extern bool plot_ricochets = false;
extern bool plot_losing_status = true;
extern bool plot_Hull = false;
extern bool plot_Hull_Arrows = false;
extern bool plot_fluctuation_brackets = false;
double FMax = FSize*6/5;
int sample=828;
int       Range_n=34;
int shift = 5;
double ExtMapBuffer[];
double conso[], conso2[];
  double iHi[];
  double iLo[]; 
  double iHi2[];
  double iLo2[];
    double iHi3[];
  double iLo3[];    
    double iHi4[];
  double iLo4[];    
      double iHi5[];
  double iLo5[];  
        double iHi6[];
  double iLo6[];  
double HiBuffer[],LoBuffer[];
double plus[],minus[],vbrl[],vbru[];
double sup[],sdn[],RSI2[],stoch[];
double ExtUpFractalsBuffer[];
double ExtDownFractalsBuffer[];
int fodir[];
double buy[];
double sell[];
double ramp[];
double UR[];
double DR[];
double URE[];
double BE[];
double SE[];
double SE60[];
double BU[];
double BU60[];
  int Hi20[];
  int Lo20[]; 
  double HPR[];
  double LPR[];
  double LCR[];
  double HCR[];
  double bline[];
  double sline[];
  double guardrailu[],guardraild[],guardraildplus[],guardraildminus[];
  double pbrainu[],pbraind[];
   double lowest_price[];
  double highest_price[]; 
  double triu[], trid[];
  extern int HULL = 33;  
  double HighBuffer[],HighBuffer2[];
double LowBuffer[],LowBuffer2[];
double dt14, db14, pacing;
  double HULLU[], HULLD[], MHULL[], inner[], HU[], HD[];
int init()
  {
  
        SetIndexBuffer(0,HighBuffer);
   SetIndexBuffer(1,LowBuffer);   
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,4,clrRed);
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,4,clrRed);
  
  
          SetIndexBuffer(2,HighBuffer2);
   SetIndexBuffer(3,LowBuffer2);   
   SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,4,clrGreen);
   SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,4,clrGreen);
  
  
   SetIndexBuffer(29,iHi);
   SetIndexStyle(29,DRAW_LINE,2,8,Blue);
   SetIndexLabel(29, "Highest(" + DoubleToStr(Range_n,0)+")");

   SetIndexBuffer(30,iLo);
   SetIndexStyle(30,DRAW_LINE,2,8,Blue);
   SetIndexLabel(30, "Lowest(" + DoubleToStr(Range_n,0)+")");
   
   SetIndexBuffer(31,bline);
   SetIndexStyle(31,DRAW_LINE,2,5,clrNONE);
 //  SetIndexArrow(2,221);
   SetIndexLabel(31, "Bline(" + DoubleToStr(Range_n,0)+")");
   
   SetIndexBuffer(32,sline);   
   SetIndexStyle(32,DRAW_LINE,2,5,clrNONE);
   SetIndexLabel(32, "Sline(" + DoubleToStr(Range_n,0)+")");
 //  SetIndexArrow(3,222);

   
   SetIndexStyle(4,DRAW_ARROW,EMPTY,7,DarkGreen);
   SetIndexArrow(4,217);
   SetIndexBuffer(4,LCR);
   SetIndexEmptyValue(4,0.0);
   
   SetIndexStyle(5,DRAW_ARROW,EMPTY,7,Yellow);
   SetIndexArrow(5,218);
   SetIndexBuffer(5,HCR);
   SetIndexEmptyValue(5,0.0);

   SetIndexStyle(6,DRAW_ARROW,EMPTY,3,Cyan);
   SetIndexArrow(6,233);
   SetIndexBuffer(6,BE);
   SetIndexEmptyValue(6,0.0);


   SetIndexBuffer(7,iHi2);
   SetIndexStyle(7,DRAW_LINE,2,8,Magenta);
   SetIndexLabel(7, "Highest(" + DoubleToStr(Range_n,0)+")");

   SetIndexBuffer(8,iLo2);
   SetIndexStyle(8,DRAW_LINE,2,8,Magenta);
   SetIndexLabel(8, "Lowest(" + DoubleToStr(Range_n,0)+")");



   SetIndexBuffer(9,iHi3);
   SetIndexStyle(9,DRAW_LINE,2,8,Peru);
 //  SetIndexLabel(9, "Highest(" + DoubleToStr(Range_n,0)+")");

   SetIndexBuffer(10,iLo3);
   SetIndexStyle(10,DRAW_LINE,2,8,Peru);
 //  SetIndexLabel(10, "Lowest(" + DoubleToStr(Range_n,0)+")");


   SetIndexBuffer(11,iHi4);
   SetIndexStyle(11,DRAW_LINE,2,8,MediumSpringGreen);
 //  SetIndexLabel(9, "Highest(" + DoubleToStr(Range_n,0)+")");

   SetIndexBuffer(12,iLo4);
   SetIndexStyle(12,DRAW_LINE,2,8,MediumSpringGreen);
 //  SetIndexLabel(10, "Lowest(" + DoubleToStr(Range_n,0)+")");



   SetIndexBuffer(13,conso2);
   SetIndexStyle(13,DRAW_LINE,2,12,clrNONE);
 //  SetIndexLabel(11, "Lowest(" + DoubleToStr(Range_n,0)+")");

   SetIndexBuffer(14,conso);
   SetIndexStyle(14,DRAW_LINE,2,5,clrNONE);
  // SetIndexLabel(12, "Lowest(" + DoubleToStr(Range_n,0)+")");


   SetIndexBuffer(15,iHi5);
   SetIndexStyle(15,DRAW_LINE,2,8,clrMaroon);


   SetIndexBuffer(16,iLo5);
   SetIndexStyle(16,DRAW_LINE,2,8,clrMaroon);


   SetIndexBuffer(17,iHi6);
   SetIndexStyle(17,DRAW_LINE,2,8,DeepPink);


   SetIndexBuffer(18,iLo6);
   SetIndexStyle(18,DRAW_LINE,2,8,DeepPink);


 SetIndexBuffer(19,guardrailu);
   SetIndexStyle(19,DRAW_LINE,2,12,clrChartreuse);
    SetIndexBuffer(20,guardraild);
   SetIndexStyle(20,DRAW_LINE,2,12,clrChartreuse);
   
   
 SetIndexBuffer(21,pbrainu);
   SetIndexStyle(21,DRAW_LINE,2,12,Purple);
    SetIndexBuffer(22,pbraind);
   SetIndexStyle(22,DRAW_LINE,2,12,Purple);
   
   SetIndexBuffer(23,triu);
   SetIndexStyle(23,DRAW_LINE,2,12,White);
    SetIndexBuffer(24,trid);
   SetIndexStyle(24,DRAW_LINE,2,12,White);
  
       SetIndexBuffer(33,inner);
   SetIndexStyle(33,DRAW_LINE,3,6,clrNONE);
  
  
     SetIndexBuffer(25,HULLU);
   SetIndexStyle(25,DRAW_LINE,3,6,Navy);
   
       SetIndexBuffer(26,HULLD);
   SetIndexStyle(26,DRAW_LINE,3,6,Yellow);
   
   
    SetIndexStyle(27,DRAW_ARROW,EMPTY,5,Yellow);
       SetIndexBuffer(27,HD);
   SetIndexArrow(27,242);

 //  SetIndexEmptyValue(27,0.0);

   SetIndexStyle(28,DRAW_ARROW,EMPTY,5,Cyan);
      SetIndexBuffer(28,HU);
   SetIndexArrow(28,241);


    SetIndexBuffer(29,guardraildplus);
   SetIndexStyle(29,DRAW_LINE,2,6,clrLime);

SetIndexBuffer(30,guardraildminus);
   SetIndexStyle(30,DRAW_LINE,2,6,clrLime);


 //  SetIndexEmptyValue(28,0.0);
   
   
  
//----
   return(0);
  }


int start()
  {
   int    i,j ;     
  

  double xHi[];
  double xLo[];  
  int SPRD[];  
   
  
  string symbol = Symbol();
  ArrayResize(fodir, 300);
ArrayInitialize(fodir, 0);   
  ArrayResize(plus, 500);   
ArrayInitialize(plus, EMPTY_VALUE); 
ArrayResize(minus, 500);   
ArrayInitialize(minus, EMPTY_VALUE);
  ArrayResize(vbru, 200);   
ArrayInitialize(vbru, EMPTY_VALUE);
ArrayResize(vbrl, 200);   
ArrayInitialize(vbrl, EMPTY_VALUE);
  ArrayResize(buy, Bars);
  ArrayResize(sell, Bars);
  ArrayResize(ramp, Bars);
  ArrayInitialize(buy, 0);
  ArrayInitialize(sell, 0);
  ArrayInitialize(ramp, 0);      
  ArrayResize(iHi, Bars);
  ArrayResize(iLo, Bars);
  ArrayInitialize(iHi, EMPTY_VALUE);
  ArrayInitialize(iLo, EMPTY_VALUE);
  ArrayResize(iHi2, Bars);
  ArrayResize(iLo2, Bars);
  ArrayInitialize(iHi2, EMPTY_VALUE);
  ArrayInitialize(iLo2, EMPTY_VALUE);     
  ArrayResize(iHi3, Bars);
  ArrayResize(iLo3, Bars);
  ArrayInitialize(iHi3, EMPTY_VALUE);
  ArrayInitialize(iLo3, EMPTY_VALUE);   
    ArrayResize(iHi4, Bars);
  ArrayResize(iLo4, Bars);
  ArrayInitialize(iHi4, EMPTY_VALUE);
  ArrayInitialize(iLo4, EMPTY_VALUE);     
   ArrayResize(iHi5, Bars);
  ArrayResize(iLo5, Bars);
  ArrayInitialize(iHi5, EMPTY_VALUE);
  ArrayInitialize(iLo5, EMPTY_VALUE);   
   ArrayResize(iHi6, Bars);
  ArrayResize(iLo6, Bars);
  ArrayInitialize(iHi6, EMPTY_VALUE);
  ArrayInitialize(iLo6, EMPTY_VALUE);          
  ArrayResize(xHi, Bars);
  ArrayResize(xLo, Bars);
  ArrayInitialize(xHi, 0);
  ArrayInitialize(xLo, 0);   
  ArrayResize(UR, Bars); 
  ArrayInitialize(UR, 0);    
  ArrayResize(DR, Bars); 
  ArrayInitialize(DR, 0);       
  ArrayResize(URE, Bars); 
  ArrayInitialize(URE, 0);
  ArrayResize(SE, Bars); 
  ArrayInitialize(SE, 0);  
  ArrayResize(BE, Bars); 
  ArrayInitialize(BE, 0);   
  ArrayResize(BU, Bars); 
  ArrayInitialize(BU, 0);     
  ArrayResize(SE60, Bars); 
  ArrayInitialize(SE60, 0);      
  ArrayResize(BU60, Bars); 
  ArrayInitialize(BU60, 0);     
  ArrayResize(SPRD, Bars); 
  ArrayInitialize(SPRD, 0);    
  ArrayResize(Hi20, Bars);
  ArrayResize(Lo20, Bars);
  ArrayInitialize(Hi20, 0);
  ArrayInitialize(Lo20, 0);       
   
  ArrayResize(LPR, Bars); 
  ArrayInitialize(LPR, 0); 
  ArrayResize(HPR, Bars); 
  ArrayInitialize(HPR, 0); 
  
  
  ArrayResize(LCR, Bars); 
  ArrayInitialize(LCR, 0); 
  ArrayResize(HCR, Bars); 
  ArrayInitialize(HCR, 0);
  ArrayResize(ExtUpFractalsBuffer, Bars);   
 ArrayInitialize(ExtUpFractalsBuffer, EMPTY_VALUE);  
  ArrayResize(ExtDownFractalsBuffer, Bars);   
 ArrayInitialize(ExtDownFractalsBuffer, EMPTY_VALUE);  
  
  ArrayResize(bline, Bars); 
  ArrayInitialize(bline, 0); 
  ArrayResize(sline, Bars); 
  ArrayInitialize(sline, 0); 
  ArrayResize(ExtMapBuffer, Bars); 
  ArrayInitialize(ExtMapBuffer, 0); 
  
    ArrayResize(HighBuffer, Bars); 
  ArrayInitialize(HighBuffer, EMPTY_VALUE);   
      ArrayResize(LowBuffer, Bars); 
  ArrayInitialize(LowBuffer, EMPTY_VALUE); 
     ArrayResize(HighBuffer2, Bars); 
  ArrayInitialize(HighBuffer2, EMPTY_VALUE);   
      ArrayResize(LowBuffer2, Bars); 
  ArrayInitialize(LowBuffer2, EMPTY_VALUE); 
  
    ArrayResize(guardrailu, Bars); 
  ArrayInitialize(guardrailu, EMPTY_VALUE);   
   ArrayResize(guardraild, Bars); 
  ArrayInitialize(guardraild, EMPTY_VALUE);  
    ArrayResize(guardraildplus, Bars); 
  ArrayInitialize(guardraildplus, EMPTY_VALUE);   
     ArrayResize(guardraildminus, Bars); 
  ArrayInitialize(guardraildminus, EMPTY_VALUE);  
  
  ArrayResize(conso, Bars); 
  ArrayInitialize(conso, EMPTY_VALUE);   
   ArrayResize(conso2, Bars); 
  ArrayInitialize(conso2, EMPTY_VALUE);  
      ArrayResize(HU, Bars); 
  ArrayInitialize(HU, EMPTY_VALUE);   
   ArrayResize(HD, Bars); 
  ArrayInitialize(HD, EMPTY_VALUE);   
    ArrayResize(HULLU, Bars); 
  ArrayInitialize(HULLU, EMPTY_VALUE);   
   ArrayResize(HULLD, Bars); 
  ArrayInitialize(HULLD, EMPTY_VALUE);  
    ArrayResize(MHULL, Bars); 
  ArrayInitialize(MHULL, EMPTY_VALUE);  
      ArrayResize(inner, Bars); 
  ArrayInitialize(inner, EMPTY_VALUE);  
 ArrayResize(sup, 500);   
ArrayInitialize(sup, 0); 
ArrayResize(sdn, 500);   
ArrayInitialize(sdn, 0); 
ArrayResize(RSI2, Bars);
ArrayInitialize(RSI2, 0);
ArrayResize(stoch, Bars);
ArrayInitialize(stoch, 0);       
//--------------------------------------------------------------------

//  highest_price[0] =  High[iHighest(NULL, 0, MODE_HIGH, 3,1)];
//   lowest_price[0] =  Low[iLowest(NULL, 0, MODE_LOW, 3,1)];


dt14 = iHigh(symbol,240,iHighest(symbol,240,MODE_HIGH,1590));
db14 = iLow(symbol,240,iLowest(symbol,240,MODE_LOW,1590));
pacing = (dt14-db14)*.1;

bool embeddedoversold = (iClose(symbol,1440,1)<db14+2*pacing && iClose(symbol,1440,2)<db14+2*pacing && iClose(symbol,1440,3)<db14+2*pacing);
bool embeddedoverbought = (iClose(symbol,1440,1)>dt14-2*pacing && iClose(symbol,1440,2)>dt14-2*pacing && iClose(symbol,1440,3)>dt14-2*pacing);


string addon;
if (embeddedoversold) addon = "-";
else if (embeddedoverbought) addon = "+";
else addon = "0";

int    nCountedBars, o, n, bar;
   bool   bFound;
   double dCurrent;
   nCountedBars=IndicatorCounted();
//---- last counted bar will be recounted    
   if(nCountedBars<=2)
      i=Bars-nCountedBars-3;
   if(nCountedBars>2)
     {
      nCountedBars--;
      i=500;
     }
//----Up and Down Fractals
   while(i>=2)
     {
      //----Fractals up
      bFound=false;
      dCurrent=High[i];
      if(dCurrent>High[i+1]  && dCurrent>High[i-1] && dCurrent>High[i-2])
       //&& dCurrent>High[i+2]
        {
         bFound=true;
         ExtUpFractalsBuffer[i]=dCurrent;
        }
      //----6 bars Fractal
      if(!bFound && (Bars-i-1)>=3)
        {
         if(dCurrent==High[i+1] && dCurrent>High[i+2]  
         //&& dCurrent>High[i+3]
            && dCurrent>High[i-1] && dCurrent>High[i-2])
           {
            bFound=true;
            ExtUpFractalsBuffer[i]=dCurrent;
           }
        }        
      //----7 bars Fractal
      if(!bFound && (Bars-i-1)>=4)
        {  
         if(dCurrent>=High[i+1]  && dCurrent>High[i+3] && dCurrent>High[i+4] &&  dCurrent==High[i+2]
            && dCurrent>High[i-1] && dCurrent>High[i-2])
           {
            bFound=true;
            ExtUpFractalsBuffer[i]=dCurrent;
           }
        }  
      //----8 bars Fractal                          
      if(!bFound && (Bars-i-1)>=5)
        {  
         if(dCurrent>=High[i+1] && dCurrent==High[i+2] && dCurrent==High[i+3] && dCurrent>High[i+4]  &&
         
        //&& dCurrent>High[i+5]
            dCurrent>High[i-1] && dCurrent>High[i-2])
           {
            bFound=true;
            ExtUpFractalsBuffer[i]=dCurrent;
           }
        }
      //----9 bars Fractal                                        
      if(!bFound && (Bars-i-1)>=6)
        {  
         if(dCurrent>=High[i+1] && dCurrent==High[i+2] && dCurrent>=High[i+3] && dCurrent==High[i+4] && dCurrent>High[i+5]  && dCurrent>High[i-1] && dCurrent>High[i-2])
           //&&             dCurrent>High[i+6]
           {
            bFound=true;
            ExtUpFractalsBuffer[i]=dCurrent;
           }
        }                                    
      //----Fractals down
      bFound=false;
      dCurrent=Low[i];
      if(dCurrent<Low[i+1]  && dCurrent<Low[i-1] && dCurrent<Low[i-2])
        //&& dCurrent<Low[i+2]
        {
         bFound=true;
         ExtDownFractalsBuffer[i]=dCurrent;
        }
      //----6 bars Fractal
      if(!bFound && (Bars-i-1)>=3)
        {
         if(dCurrent==Low[i+1] && dCurrent<Low[i+2]  &&
            dCurrent<Low[i-1] && dCurrent<Low[i-2])
           //&& dCurrent<Low[i+3]
           {
            bFound=true;
            ExtDownFractalsBuffer[i]=dCurrent;
           }                      
        }        
      //----7 bars Fractal
      if(!bFound && (Bars-i-1)>=4)
        {  
         if(dCurrent<=Low[i+1] && dCurrent==Low[i+2] && dCurrent<Low[i+3]  &&
            dCurrent<Low[i-1] && dCurrent<Low[i-2])
          //&& dCurrent<Low[i+4]  
           {
            bFound=true;
            ExtDownFractalsBuffer[i]=dCurrent;
           }                      
        }  
      //----8 bars Fractal                          
      if(!bFound && (Bars-i-1)>=5)
        {  
         if(dCurrent<=Low[i+1] && dCurrent==Low[i+2] && dCurrent==Low[i+3] && dCurrent<Low[i+4]  &&
            dCurrent<Low[i-1] && dCurrent<Low[i-2])
           //&& dCurrent<Low[i+5] 
           {
            bFound=true;
            ExtDownFractalsBuffer[i]=dCurrent;
           }                      
        }
      //----9 bars Fractal                                        
      if(!bFound && (Bars-i-1)>=6)
        {  
         if(dCurrent<=Low[i+1] && dCurrent==Low[i+2] && dCurrent<=Low[i+3] && dCurrent==Low[i+4] && dCurrent<Low[i+5]  && dCurrent<Low[i-1] && dCurrent<Low[i-2])
           //&&             dCurrent<Low[i+6]
           {
            bFound=true;
            ExtDownFractalsBuffer[i]=dCurrent;
           }                      
        }                                    
      i--;
     }

for (i = 300 ; i >= 0; i--){ 
   RSI2[i]=iRSI(symbol,0,2,PRICE_MEDIAN,i);
   stoch[i]=iStochastic(symbol,0,8,3,3,MODE_SMA,1,MODE_SIGNAL,i);
}   

for (i=240; i>=1; i--){

if(stoch[i+1]<23 && RSI2[i+1]<16  && RSI2[i+3]>5 && !(stoch[i]<5 && RSI2[i]<5)&& 
ExtDownFractalsBuffer[i+1]!=EMPTY_VALUE) sdn[i+1]=iLow(symbol,30,i+1); 
if(stoch[i+1]<23 && RSI2[i+1]<16  && !(stoch[i]<5 && RSI2[i]<5)&& 
ExtDownFractalsBuffer[i+1]!=EMPTY_VALUE)sdn[i+1]=iLow(symbol,30,i+1); 
if(stoch[i+1]<44 && stoch[i+1]>5 && RSI2[i+1]>5 && !(stoch[i]>15 && RSI2[i]>15) && 
ExtDownFractalsBuffer[i+1]!=EMPTY_VALUE) sdn[i+1]=iLow(symbol,30,i+1);
if(stoch[i+1]<5 && RSI2[i+1]<5 && !(stoch[i]>15 && RSI2[i]>15) && 
ExtDownFractalsBuffer[i+1]!=EMPTY_VALUE) sdn[i+1]=iLow(symbol,30,i+1);
if( ((stoch[i+1]>64 && stoch[i]<85 && RSI2[i+2]>85) ||  (stoch[i+1]>72 && stoch[i+1]<75 )  ||  (stoch[i]>44 && stoch[i+1]<35 && stoch[i-1]<44  && RSI2[i+1]>85 )) && RSI2[i+1]>70 && !(stoch[i-1]>95 && RSI2[i-1]>95) && 
ExtUpFractalsBuffer[i+1]!=EMPTY_VALUE && !sup[i+2]) sup[i+1]=iHigh(symbol,30,i+1);
if(stoch[i+1]>64 && stoch[i+2]<64 && RSI2[i+1]>85 && !(stoch[i]>70 && RSI2[i]>95) && 
ExtUpFractalsBuffer[i+2]!=EMPTY_VALUE && !sup[i+2]) sup[i+1]=iHigh(symbol,30,i+1);
if(stoch[i+1]>85 && RSI2[i+1]>85 && !(stoch[i]>85 && RSI2[i]>95) &&  
ExtUpFractalsBuffer[i+1]!=EMPTY_VALUE && !sup[i+2]) sup[i+1]=iHigh(symbol,30,i+1);
        
minus[i]=minus[i+1];
plus[i]=plus[i+1];     

     if (sdn[i+1]!=0) minus[i]=Low[i+1]-110*Point+FSize/2*10*Point;
     if (sup[i+1]!=0) plus[i]=High[i+1]+100*Point-FSize/2*10*Point; 
 }



deletetxt1("Rack");
if (Period()<=1440) {
   for (i = lookback ; i >= 0; i--) {
   
  
   iHi[i]=EMPTY_VALUE;
   iLo[i]=EMPTY_VALUE;
   guardrailu[i] = EMPTY_VALUE;
   guardraild[i] = EMPTY_VALUE;
   
   HULLU[i]=EMPTY_VALUE;
   HULLD[i]=EMPTY_VALUE;
   MHULL[i]=EMPTY_VALUE;
   inner[i]=EMPTY_VALUE;
   HU[i]=EMPTY_VALUE;
   HD[i]=EMPTY_VALUE;
   
   
//     highest_price[i] =  iHigh(NULL,0,iHighest(NULL, 0, MODE_HIGH, 2,i+3));
 //  lowest_price[i] =  iLow(NULL,0,iLowest(NULL, 0, MODE_LOW, 2,i+3));
    if (i<lookback) iHi[i]=iMA(NULL,0,828,0,MODE_EMA, PRICE_HIGH,i);
    if (i<lookback) iLo[i]=iMA(NULL,0,828,0,MODE_EMA, PRICE_LOW,i);
    if (i<lookback) iHi2[i]=iMA(NULL,0,1556,0,MODE_EMA, PRICE_HIGH,i);
    if (i<lookback) iLo2[i]=iMA(NULL,0,1556,0,MODE_EMA, PRICE_LOW,i);
 if (i<lookback) iHi3[i]=iMA(NULL,0,sample*48,0,MODE_EMA, PRICE_HIGH,i);
    if (i<lookback) iLo3[i]=iMA(NULL,0,sample*48,0,MODE_EMA, PRICE_LOW,i);
     if (i<lookback) iHi4[i]=iMA(NULL,0,414,0,MODE_EMA, PRICE_HIGH,i);
    if (i<lookback) iLo4[i]=iMA(NULL,0,414,0,MODE_EMA, PRICE_LOW,i);

     if (i<lookback) iHi5[i]=iMA(NULL,0,135,0,MODE_EMA, PRICE_HIGH,i);
    if (i<lookback) iLo5[i]=iMA(NULL,0,135,0,MODE_EMA, PRICE_LOW,i);
    
        if (i<lookback) iHi6[i]=iMA(NULL,0,sample*8,0,MODE_EMA, PRICE_HIGH,i);
    if (i<lookback) iLo6[i]=iMA(NULL,0,sample*8,0,MODE_EMA, PRICE_LOW,i);
    
   if (Period()==30){ 
    
    guardrailu[i] =  iMA(symbol,0,414,0,MODE_EMA, PRICE_HIGH,i)+FMax*10*Point;
    
    guardraild[i] =  iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i)-FMax*10*Point;
    
     guardraildplus[i] =  guardraild[i]+90*Point;
     guardraildminus[i] =  guardraild[i]-90*Point;
    
    
    pbrainu[i] =  iMA(symbol,0,414,0,MODE_EMA, PRICE_HIGH,i)+3*FMax*10*Point;
    pbraind[i] =  iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i)-3*FMax*10*Point;
    
 triu[i] =  iMA(symbol,0,414,0,MODE_EMA, PRICE_HIGH,i)+5*FMax*10*Point;
    trid[i] =  iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i)-5*FMax*10*Point;}

inner[i]=2*iMA(NULL,0,HULL/2,8,MODE_LWMA,PRICE_MEDIAN,i)- iMA(NULL,0,HULL,8,MODE_LWMA,PRICE_MEDIAN,i);

MHULL[i] = iMA(NULL,0,MathRound(MathSqrt(HULL)),8,MODE_LWMA,inner[i],i);

if (i<200){
//Low[i+9]<minus[i+9] && Low[i+8]<minus[i+8] && Low[i+7]<minus[i+7] && 
          if (Low[i+6]<minus[i+6] && Low[i+5]<minus[i+5] && Low[i+4]<minus[i+4] && Low[i+3]<minus[i+3]  && Low[i+2]<minus[i+2] && iLow(symbol,0,i+1)>minus[i+1] && i>=1 ){
           if (iLow(symbol,0,i+2)<minus[i+2]) if (plot_losing_status){ {ObjectCreate("Rack"+i, OBJ_RECTANGLE, 0, Time[i+2], Low[i+1], Time[i], iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,8,i+2)));
           ObjectSet("Rack"+i,OBJPROP_BACK,1);
            ObjectSetInteger(0,"Rack"+i,OBJPROP_COLOR,clrGreen); } fodir[i]=1; }}
//High[i+8]>plus[i+8] && High[i+7]>plus[i+7] &&                  
              if ( High[i+6]>plus[i+6] && High[i+5]>plus[i+5] && High[i+4]>plus[i+4] && High[i+3]>plus[i+3] && High[i+2]>plus[i+2] && High[i+3]>plus[i+3] && High[i+2]>plus[i+2] && iHigh(symbol,0,i+1)<plus[i+1] && i>=1 ){
         if (iHigh(symbol,0,i+2)>plus[i+2])if (plot_losing_status){ {ObjectCreate("Rack"+i, OBJ_RECTANGLE, 0, Time[i+2], High[i+1], Time[i], iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,8,i+2)));
          ObjectSet("Rack"+i,OBJPROP_BACK,1);
            ObjectSetInteger(0,"Rack"+i,OBJPROP_COLOR,clrMagenta);} } fodir[i]=-1;  }}


if (plot_Hull){
if (MHULL[i]<MHULL[i+1] && MHULL[i]!=0) HULLD[i]=MHULL[i];
else if (MHULL[i]>MHULL[i+1] && MHULL[i]!=0) HULLU[i]=MHULL[i];
}

if (plot_Hull_Arrows){
   
if (HULLU[i+6]!=EMPTY_VALUE && HULLU[i+3]!=EMPTY_VALUE && HULLU[i+4]!=EMPTY_VALUE && HULLU[i+5]!=EMPTY_VALUE && HULLD[i]!=EMPTY_VALUE && HULLD[i+1]!=EMPTY_VALUE && Period()==30) HD[i]=HULLD[i]+FSize/4*10*Point;
else HD[i]=EMPTY_VALUE;
if   (HULLD[i+6]!=EMPTY_VALUE && HULLD[i+3]!=EMPTY_VALUE && HULLD[i+4]!=EMPTY_VALUE && HULLD[i+5]!=EMPTY_VALUE && HULLU[i]!=EMPTY_VALUE && HULLU[i+1]!=EMPTY_VALUE && Period()==30 ) HU[i]=HULLU[i]-FSize/4*10*Point;
else HU[i]=EMPTY_VALUE;}

if (plot_Spark_Sones){

 ///Maroon Above Green River
     if ( iMA(symbol,0,135,0,MODE_EMA, PRICE_LOW,i)>iMA(symbol,0,414,0,MODE_EMA, PRICE_HIGH,i) && iMA(symbol,0,135,0,MODE_EMA, PRICE_LOW,i)-iMA(symbol,0,414,0,MODE_EMA, PRICE_HIGH,i)<FSize/1.4*10*Point
           && LowComparison(i,30) == False) {HighBuffer2[i]=iMA(symbol,0,135,0,MODE_EMA, PRICE_LOW,i); LowBuffer2[i]=iMA(symbol,0,414,0,MODE_EMA, PRICE_HIGH,i);}
 
 ///Maroon Below Green River
     if ( iMA(symbol,0,135,0,MODE_EMA, PRICE_HIGH,i)<iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i)-iMA(symbol,0,135,0,MODE_EMA, PRICE_HIGH,i)<FSize/1.4*10*Point
            && HighComparison(i,30) == False) {HighBuffer[i]=iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i); LowBuffer[i]=iMA(symbol,0,135,0,MODE_EMA, PRICE_HIGH,i);}
     }
     
     }
     
   for (i = 120 ; i >= 0; i--) {
     bline[i]=EMPTY_VALUE;
     sline[i]=EMPTY_VALUE;
     if (i<108) bline[i]=iHi[i]+ MathAbs(((iHi[i]-iHi[i+36])/36)*60);
    // MathAbs((iHi[i]-iHi[i+36])/36*60);
     if (i<108) sline[i]=iLo[i]-MathAbs(((iLo[i+36]-iLo[i])/36)*60);
  //   MathAbs((iLo[i+36]-iLo[i])/36*60);
     }


   for (i = 100 ; i >=0 ; i--) {
     if ((Open[i]>sline[i] &&  Bid<=sline[i]) && Close[i+2]>sline[i+2] ) sell[i]=sline[i];
    // MathAbs((iHi[i]-iHi[i+36])/36*60);
    if (sell[i]>0 && sell[i+1]==0 && Low[iLowest(NULL, 0, MODE_LOW, 3,i+1)]<sline[i]) HCR[i]=Low[iLowest(NULL, 0, MODE_LOW, 2,i+3)]+.001;
        if ((Close[i]>bline[i]&&Low[i+1]<bline[i+1])  ||  (Close[i+1]<sline[i+1] && Close[i+2]<sline[i+2] && Ask>=sline[i])) buy[i]=bline[i];
    if (buy[i]>0 && buy[i+1]==0 && High[iHighest(NULL, 0, MODE_HIGH, 3,i+1)]>bline[i]) LCR[i]=High[iHighest(NULL, 0, MODE_HIGH, 2,i+3)]-.001;    
  //   MathAbs((iLo[i+36]-iLo[i])/36*60);
     }


   
   
      for (i = 0 ; i <= 420; i++) {
      //conso[i]=EMPTY_VALUE;
    //  Print("MathAbs((ChoppinessIndex(14,i)-ChoppinessIndex(14,i+5))<1) ",i,"]:", MathAbs((ChoppinessIndex(14,i)-ChoppinessIndex(14,i+5)))); 
               if ((MathAbs((ChoppinessIndex(14,i)-ChoppinessIndex(14,i+4))>6) && MathAbs((ChoppinessIndex(14,i)-ChoppinessIndex(14,i+8))>6) && Period()==30)
                   ||  (MathAbs((ChoppinessIndex(7,i)-ChoppinessIndex(7,i+2))>5) && MathAbs((ChoppinessIndex(7,i)-ChoppinessIndex(7,i+4))>5) && Period()>30 ))
                   
                {
                     for (j=i; j <= i+3; j++){
                        conso[j]=(High[i]+High[i+1]+High[i+2]+High[i+3]+Low[i]+Low[i+1]+Low[i+2]+Low[i+3])/8;  conso2[j]=conso[j];}}
     }

   
   }

deletetxt1("Rake");
deletetxt1("Fake");
deletetxt1("ZERO");
deletetxt1("HUNDRA");

if (Period()==30){  
for(i = 240; i >= 0; i--){     


if (i>=0 && RSI2[i+1]>hundred && RSI2[i]<RSI2[i+1]){
               ObjectCreate("HUNDRA"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+250*Point);
                 ObjectSetText("HUNDRA"+i, "100", 53, "Arial Black", clrPink);
                 ObjectCreate("HUNDRAz"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+250*Point);
                 ObjectSetText("HUNDRAz"+i, " 100", 53, "Arial Black", clrNavy);}    


if (i==0 && RSI2[i]>hundred){
               ObjectCreate("HUNDRA"+i,OBJ_TEXT, 0, Time[i], High[i]+250*Point);
                 ObjectSetText("HUNDRA"+i, "100", 53, "Arial Black", clrPink);
                 ObjectCreate("HUNDRAz"+i,OBJ_TEXT, 0, Time[i], High[i]+250*Point);
                 ObjectSetText("HUNDRAz"+i, " 100", 53, "Arial Black", clrPowderBlue);}    




if (i>=0 && RSI2[i+1]<zero && RSI2[i]>RSI2[i+1]){
               ObjectCreate("ZERO"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-5*Point);
                 ObjectSetText("ZERO"+i, "0", 53, "Arial Black", clrPink);
                 ObjectCreate("ZEROz"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-5*Point);
                 ObjectSetText("ZEROz"+i, " 0", 53, "Arial Black", clrNavy);}    


if (i==0 && RSI2[i]<zero){
               ObjectCreate("ZERO"+i,OBJ_TEXT, 0, Time[i], Low[i]-5*Point);
                 ObjectSetText("ZERO"+i, "0", 53, "Arial Black", clrPink);
                 ObjectCreate("ZEROz"+i,OBJ_TEXT, 0, Time[i], Low[i]-5*Point);
                 ObjectSetText("ZEROz"+i, " 0", 53, "Arial Black", PowderBlue);}    


if (plot_ricochets){
    
                 
///////RAKE

////Maroon                 
//Low[i+2]>Low[i+1] 
if ( Low[i+1]< iMA(symbol,0,135,0,MODE_EMA, PRICE_HIGH,i+1)+40*Point && Low[i+1]> iMA(symbol,0,135,0,MODE_EMA, PRICE_HIGH,i+1)-20*Point
     && Close[i+1]> iMA(symbol,0,135,0,MODE_EMA, PRICE_HIGH,i+1)+50*Point && Low[i]>Low[i+1] &&
     !(Low[i+3]>Low[i+2] && Low[i+2]< iMA(symbol,0,135,0,MODE_EMA, PRICE_CLOSE,i+2)+30*Point && Low[i+2]> iMA(symbol,0,135,0,MODE_EMA, PRICE_HIGH,i+2)-80*Point
     && Close[i+2]> iMA(symbol,0,135,0,MODE_EMA, PRICE_CLOSE,i+2)+50*Point && Low[i+1]>Low[i+2])){
                 ObjectCreate("Rakei"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-10*Point);
                 ObjectSetText("Rakei"+i, "R", 33, "Arial Black", clrYellow);
                 ObjectCreate("Raker"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-10*Point);
                 ObjectSetText("Raker"+i, " R", 33, "Arial Black", clrBlack);}
        

///////2H Lema

if (Low[i+2]>Low[i+1] && Low[i+1]< iMA(symbol,0,1556,0,MODE_EMA, PRICE_HIGH,i+1)-30*Point && Low[i+1]> iMA(symbol,0,1556,0,MODE_EMA, PRICE_HIGH,i+1)+20*Point
     && Close[i+1]> iMA(symbol,0,1556,0,MODE_EMA, PRICE_HIGH,i+1)+50*Point && Low[i]>Low[i+1] &&
     !(Low[i+3]>Low[i+2] && Low[i+2]< iMA(symbol,30,1556,0,MODE_EMA, PRICE_CLOSE,i+2)+30*Point && Low[i+2]> iMA(symbol,0,1556,0,MODE_EMA, PRICE_HIGH,i+2)-80*Point
     && Close[i+2]> iMA(symbol,0,1556,0,MODE_EMA, PRICE_CLOSE,i+2)+50*Point && Low[i+1]>Low[i+2])){
                 ObjectCreate("Rakei"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-10*Point);
                 ObjectSetText("Rakei"+i, "R", 33, "Arial Black", clrYellow);
                 ObjectCreate("Raker"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-10*Point);
                 ObjectSetText("Raker"+i, " R", 33, "Arial Black", clrBlack);}


//////19872

if (Low[i+2]>Low[i+1] && Low[i+1]< iMA(symbol,0,19872,0,MODE_EMA, PRICE_HIGH,i+1)-30*Point && Low[i+1]> iMA(symbol,0,19872,0,MODE_EMA, PRICE_HIGH,i+1)+20*Point
     && Close[i+1]> iMA(symbol,0,19872,0,MODE_EMA, PRICE_HIGH,i+1)+50*Point && Low[i]>Low[i+1] &&
     !(Low[i+3]>Low[i+2] && Low[i+2]< iMA(symbol,0,19872,0,MODE_EMA, PRICE_CLOSE,i+2)+30*Point && Low[i+2]> iMA(symbol,0,19872,0,MODE_EMA, PRICE_HIGH,i+2)-80*Point
     && Close[i+2]> iMA(symbol,0,19872,0,MODE_EMA, PRICE_CLOSE,i+2)+50*Point && Low[i+1]>Low[i+2])){
                 ObjectCreate("Rakei"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-40*Point);
                 ObjectSetText("Rakei"+i, "R", 33, "Arial Black", clrYellow);
                 ObjectCreate("Raker"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-40*Point);
                 ObjectSetText("Raker"+i, " R", 33, "Arial Black", clrBlack);}


//////39744

if (Low[i+2]>Low[i+1] && Low[i+1]< iMA(symbol,0,39744,0,MODE_EMA, PRICE_HIGH,i+1)-30*Point && Low[i+1]> iMA(symbol,0,39744,0,MODE_EMA, PRICE_HIGH,i+1)+20*Point
     && Close[i+1]> iMA(symbol,0,39744,0,MODE_EMA, PRICE_HIGH,i+1)+50*Point && Low[i]>Low[i+1] &&
     !(Low[i+3]>Low[i+2] && Low[i+2]< iMA(symbol,0,39744,0,MODE_EMA, PRICE_CLOSE,i+2)+30*Point && Low[i+2]> iMA(symbol,0,39744,0,MODE_EMA, PRICE_HIGH,i+2)-80*Point
     && Close[i+2]> iMA(symbol,0,39744,0,MODE_EMA, PRICE_CLOSE,i+2)+50*Point && Low[i+1]>Low[i+2])){
                 ObjectCreate("Rakei"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-40*Point);
                 ObjectSetText("Rakei"+i, "R", 33, "Arial Black", clrMagenta);
                 ObjectCreate("Raker"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-40*Point);
                 ObjectSetText("Raker"+i, " R", 33, "Arial Black", clrBlack);}

////30m Lema 
if (Low[i+2]>Low[i+1] && Low[i+1]< iMA(symbol,0,828,0,MODE_EMA, PRICE_HIGH,i+1)-30*Point && Low[i+1]> iMA(symbol,0,828,0,MODE_EMA, PRICE_HIGH,i+1)+20*Point
     && Close[i+1]> iMA(symbol,0,828,0,MODE_EMA, PRICE_HIGH,i+1)+50*Point && Low[i]>Low[i+1] &&
     !(Low[i+3]>Low[i+2] && Low[i+2]< iMA(symbol,0,828,0,MODE_EMA, PRICE_CLOSE,i+2)+30*Point && Low[i+2]> iMA(symbol,0,828,0,MODE_EMA, PRICE_HIGH,i+2)-80*Point
     && Close[i+2]> iMA(symbol,0,828,0,MODE_EMA, PRICE_CLOSE,i+2)+50*Point && Low[i+1]>Low[i+2])){
                 ObjectCreate("Rakei"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-10*Point);
                 ObjectSetText("Rakei"+i, "R", 33, "Arial Black", clrYellow);
                 ObjectCreate("Raker"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-10*Point);
                 ObjectSetText("Raker"+i, " R", 33, "Arial Black", clrBlack);} 

////Green River
if (Low[i+2]>Low[i+1] && Low[i+1]< iMA(symbol,0,414,0,MODE_EMA, PRICE_HIGH,i+1)-30*Point && Low[i+1]> iMA(symbol,0,414,0,MODE_EMA, PRICE_HIGH,i+1)+20*Point
     && Close[i+1]> iMA(symbol,0,414,0,MODE_EMA, PRICE_HIGH,i+1)+50*Point && Low[i]>Low[i+1] &&
     !(Low[i+3]>Low[i+2] && Low[i+2]< iMA(symbol,0,414,0,MODE_EMA, PRICE_CLOSE,i+2)+30*Point && Low[i+2]> iMA(symbol,0,414,0,MODE_EMA, PRICE_HIGH,i+2)-80*Point
     && Close[i+2]> iMA(symbol,0,414,0,MODE_EMA, PRICE_CLOSE,i+2)+50*Point && Low[i+1]>Low[i+2])){
                 ObjectCreate("Rakei"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-10*Point);
                 ObjectSetText("Rakei"+i, "R", 33, "Arial Black", clrYellow);
                 ObjectCreate("Raker"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-10*Point);
                 ObjectSetText("Raker"+i, " R", 33, "Arial Black", clrBlack);}  
 




                 


//////////////////Rebound from above


///Maroon
 if (High[i+2]<High[i+1] && High[i+1]< iMA(symbol,0,135,0,MODE_EMA, PRICE_LOW,i+1)+30*Point && High[i+1]> iMA(symbol,0,135,0,MODE_EMA, PRICE_LOW,i+1)-20*Point
     && Close[i+1]< iMA(symbol,0,135,0,MODE_EMA, PRICE_LOW,i+1)+50*Point && High[i]<High[i+1] &&
     !(High[i+3]<High[i+2] && High[i+2]< iMA(symbol,0,135,0,MODE_EMA, PRICE_LOW,i+2)+30*Point && High[i+2]> iMA(symbol,0,135,0,MODE_EMA, PRICE_LOW,i+2)-20*Point
     && Close[i+2]< iMA(symbol,0,135,0,MODE_EMA, PRICE_LOW,i+2)+50*Point && High[i+1]<High[i+2])){
               ObjectCreate("Raken"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+20*Point);
                 ObjectSetText("Raken"+i, "R", 33, "Arial Black", clrBlack);
                 ObjectCreate("Rakez"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+20*Point);
                 ObjectSetText("Rakez"+i, " R", 33, "Arial Black", clrYellow);}

/////2H Lema
 if (High[i+2]<High[i+1] && High[i+1]< iMA(symbol,0,1556,0,MODE_EMA, PRICE_LOW,i+1)+30*Point && High[i+1]> iMA(symbol,0,1556,0,MODE_EMA, PRICE_LOW,i+1)-20*Point
     && Close[i+1]< iMA(symbol,0,1556,0,MODE_EMA, PRICE_LOW,i+1)+50*Point && High[i]<High[i+1] &&
     !(High[i+3]<High[i+2] && High[i+2]< iMA(symbol,0,1556,0,MODE_EMA, PRICE_LOW,i+2)+30*Point && High[i+2]> iMA(symbol,0,1556,0,MODE_EMA, PRICE_LOW,i+2)-20*Point
     && Close[i+2]< iMA(symbol,0,1556,0,MODE_EMA, PRICE_LOW,i+2)+50*Point && High[i+1]<High[i+2])){
               ObjectCreate("Raken"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+20*Point);
                 ObjectSetText("Raken"+i, "R", 33, "Arial Black", clrBlack);
                 ObjectCreate("Rakez"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+20*Point);
                 ObjectSetText("Rakez"+i, " R", 33, "Arial Black", clrYellow);}

                 
////19872       
 if (High[i+2]<High[i+1] && High[i+1]< iMA(symbol,0,19872,0,MODE_EMA, PRICE_LOW,i+1)+30*Point && High[i+1]> iMA(symbol,0,19872,0,MODE_EMA, PRICE_LOW,i+1)-20*Point
     && Close[i+1]< iMA(symbol,0,19872,0,MODE_EMA, PRICE_LOW,i+1)+50*Point && High[i]<High[i+1] &&
     !(High[i+3]<High[i+2] && High[i+2]< iMA(symbol,0,19872,0,MODE_EMA, PRICE_LOW,i+2)+30*Point && High[i+2]> iMA(symbol,0,19872,0,MODE_EMA, PRICE_LOW,i+2)-20*Point
     && Close[i+2]< iMA(symbol,0,19872,0,MODE_EMA, PRICE_LOW,i+2)+50*Point && High[i+1]<High[i+2])){
               ObjectCreate("Raken"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+20*Point);
                 ObjectSetText("Raken"+i, "R", 33, "Arial Black", clrBlack);
                 ObjectCreate("Rakez"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+20*Point);
                 ObjectSetText("Rakez"+i, " R", 33, "Arial Black", clrYellow);}               
                 
/////39744
    if (High[i+2]<High[i+1] && High[i+1]< iMA(symbol,0,39744,0,MODE_EMA, PRICE_LOW,i+1)+30*Point && High[i+1]> iMA(symbol,0,39744,0,MODE_EMA, PRICE_LOW,i+1)-20*Point
     && Close[i+1]< iMA(symbol,0,39744,0,MODE_EMA, PRICE_LOW,i+1)+50*Point && High[i]<High[i+1] &&
     !(High[i+3]<High[i+2] && High[i+2]< iMA(symbol,0,39744,0,MODE_EMA, PRICE_LOW,i+2)+30*Point && High[i+2]> iMA(symbol,0,39744,0,MODE_EMA, PRICE_LOW,i+2)-20*Point
     && Close[i+2]< iMA(symbol,0,39744,0,MODE_EMA, PRICE_LOW,i+2)+50*Point && High[i+1]<High[i+2])){
               ObjectCreate("Raken"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+20*Point);
                 ObjectSetText("Raken"+i, "R", 33, "Arial Black", clrBlack);
                 ObjectCreate("Rakez"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]-20*Point);
                 ObjectSetText("Rakez"+i, " R", 33, "Arial Black", clrMagenta);}                    
                 
////30m Lema      
  if (High[i+2]<High[i+1] && High[i+1]< iMA(symbol,0,828,0,MODE_EMA, PRICE_LOW,i+1)+30*Point && High[i+1]> iMA(symbol,0,828,0,MODE_EMA, PRICE_LOW,i+1)-20*Point
     && Close[i+1]< iMA(symbol,0,828,0,MODE_EMA, PRICE_LOW,i+1)+50*Point && High[i]<High[i+1] &&
     !(High[i+3]<High[i+2] && High[i+2]< iMA(symbol,0,828,0,MODE_EMA, PRICE_LOW,i+2)+30*Point && High[i+2]> iMA(symbol,0,828,0,MODE_EMA, PRICE_LOW,i+2)-20*Point
     && Close[i+2]< iMA(symbol,0,828,0,MODE_EMA, PRICE_LOW,i+2)+50*Point && High[i+1]<High[i+2])){
                ObjectCreate("Raken"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+20*Point);
                 ObjectSetText("Raken"+i, "R", 33, "Arial Black", clrBlack);
                 ObjectCreate("Rakez"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+20*Point);
                 ObjectSetText("Rakez"+i, " R", 33, "Arial Black", clrYellow);}               


////Green River     
   if (High[i+2]<High[i+1] && High[i+1]< iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+1)+30*Point && High[i+1]> iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+1)-20*Point
     && Close[i+1]< iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+1)+50*Point && High[i]<High[i+1] &&
     !(High[i+3]<High[i+2] && High[i+2]< iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+2)+30*Point && High[i+2]> iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+2)-20*Point
     && Close[i+2]< iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+2)+50*Point && High[i+1]<High[i+2])){
               ObjectCreate("Raken"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Raken"+i, "R", 33, "Arial Black", clrBlack);
                 ObjectCreate("Rakez"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Rakez"+i, " R", 33, "Arial Black", clrYellow);}   


////Lower Guard Rail
 if (High[i+2]<High[i+1] && High[i+1]< iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+1)-FMax*10*Point+30*Point && High[i+1]> iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+1)-20*Point
     && Close[i+1]< iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+1)-FMax*10*Point+50*Point && High[i]<High[i+1] &&
     !(High[i+3]<High[i+2] && High[i+2]< iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point+30*Point && High[i+2]> iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+2)-20*Point
     && Close[i+2]< iMA(symbol,0,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point+50*Point && High[i+1]<High[i+2])){
                ObjectCreate("Rakent"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Rakent"+i, "R", 33, "Arial Black", clrBlack);
                 ObjectCreate("Rakezt"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Rakezt"+i, " R", 33, "Arial Black", clrYellow);}   
}


 ////////////////
//Fake
/////////////////
    
    ////Maroon                 

       if ( High[i+1]> iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,i+1)-30*Point && High[i+1]< iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,i+1)+80*Point
     && Close[i+1]< iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,i+1)-30*Point && High[i]<High[i+1]
     && Low[i+1]<Low[i+2] && Low[i+5]<iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i+5)
     && Low[i+3]<iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,i+3)
    && !(High[i+2]> iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,i+2)-30*Point && High[i+2]< iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,i+2)+80*Point
    && Close[i+2]< iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,i+2)-50*Point && High[i+1]<High[i+2])
    ) {
                 ObjectCreate("Fakei"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+50*Point);
                 ObjectSetText("Fakei"+i, "F", 33, "Arial Black", clrYellow);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+50*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Arial Black", clrBlue);
                 fodir[i]=-1;
                 }
        

///////2H Lema

 if (Low[i+2]<Low[i+1] && High[i+1]> iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,i+1)-30*Point && High[i+1]< iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,i+1)+20*Point
     && Close[i+1]< iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,i+1)-50*Point && High[i]<High[i+1]
     && !(High[i+2]> iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,i+2)-30*Point && High[i+2]< iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,i+2)+20*Point
     && Close[i+2]< iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,i+2)-50*Point && High[i+1]<High[i+2])){
                 ObjectCreate("Fakei"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Fakei"+i, "F", 33, "Arial Black", clrYellow);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Arial Black", clrBlack);
                 fodir[i]=-1;}


//////19872

if (Low[i+2]<Low[i+1] && High[i+1]> iMA(symbol,30,19872,0,MODE_EMA, PRICE_HIGH,i+1)-30*Point && High[i+1]< iMA(symbol,30,19872,0,MODE_EMA, PRICE_HIGH,i+1)+20*Point
     && Close[i+1]< iMA(symbol,30,19872,0,MODE_EMA, PRICE_HIGH,i+1)-10*Point && High[i]<High[i+1]
     && !(High[i+2]> iMA(symbol,30,19872,0,MODE_EMA, PRICE_HIGH,i+2)-30*Point && High[i+2]< iMA(symbol,30,19872,0,MODE_EMA, PRICE_HIGH,i+2)+20*Point
     && Close[i+2]< iMA(symbol,30,19872,0,MODE_EMA, PRICE_HIGH,i+2)-10*Point && High[i+1]<High[i+2])){
                 ObjectCreate("Fakei"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Fakei"+i, "F", 33, "Arial Black", clrYellow);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Arial Black", clrBlack);
                 fodir[i]=-1;}


//////39744

if (Low[i+2]<Low[i+1] && High[i+1]> iMA(symbol,30,39744,0,MODE_EMA, PRICE_HIGH,i+1)-30*Point && High[i+1]< iMA(symbol,30,39744,0,MODE_EMA, PRICE_HIGH,i+1)+20*Point
     && Close[i+1]< iMA(symbol,30,39744,0,MODE_EMA, PRICE_HIGH,i+1)-10*Point && High[i]<High[i+1]
     && !(High[i+2]> iMA(symbol,30,39744,0,MODE_EMA, PRICE_HIGH,i+2)-30*Point && High[i+2]< iMA(symbol,30,39744,0,MODE_EMA, PRICE_HIGH,i+2)+20*Point
     && Close[i+2]< iMA(symbol,30,39744,0,MODE_EMA, PRICE_HIGH,i+2)-10*Point && High[i+1]<High[i+2])){
                 ObjectCreate("Fakei"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Fakei"+i, "F", 33, "Arial Black", clrMagenta);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Arial Black", clrBlack);
                 fodir[i]=-1;}

////30m Lema 
if (Low[i+2]<Low[i+1] && High[i+1]> iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,i+1)-30*Point && High[i+1]< iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,i+1)+20*Point
     && Close[i+1]< iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,i+1)-10*Point && High[i]<High[i+1]
     && !(High[i+2]> iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,i+2)-30*Point && High[i+2]< iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,i+2)+20*Point
     && Close[i+2]< iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,i+2)-10*Point && High[i+1]<High[i+2])){
                 ObjectCreate("Fakei"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Fakei"+i, "F", 33, "Arial Black", clrYellow);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Arial Black", clrBlack);
                 fodir[i]=-1;} 

////Green River
if (High[i+2]<High[i+1] && High[i+1]> iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+1)-35*Point && High[i+1]< iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+1)+20*Point
     && Close[i+1]< iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+1)-50*Point && High[i]<High[i+1] 
     && (Low[i+3]<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+3)  || Low[i+4]<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+4) ||  Low[i+5]<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+5))
     && !(High[i+2]> iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+2)-35*Point && High[i+2]< iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+2)+20*Point
     && Close[i+2]< iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+2)-50*Point && High[i+1]<High[i+2])
         
      ){
                 ObjectCreate("Fakei"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Fakei"+i, "F", 33, "Arial Black", clrYellow);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Arial Black", clrBlack);
                 fodir[i]=-1;}  
                 
////Lower Guard Rail
  if (High[i+2]>High[i+1] && High[i+1]< iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+1)-FMax*10*Point+100*Point && High[i+1]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+1)-FMax*10*Point-20*Point
     && Close[i+1]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+1)-FMax*10*Point+50*Point && Low[i]>Low[i+1]
     && Low[i+2]<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+1)-FMax*10*Point
     && !(Low[i+2]< iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point+30*Point && Low[i+2]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point-20*Point
     && Close[i+2]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point+50*Point && Low[i+1]>Low[i+2])
     && (Open[i+2]<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point  || Open[i+1]<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point)
     ){
                ObjectCreate("Fakeii"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+50*Point);
                 ObjectSetText("Fakeii"+i, "F", 33, "Arial Black", clrYellow);
                 ObjectCreate("Fakeri"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+50*Point);
                 ObjectSetText("Fakeri"+i, " F", 33, "Arial Black", clrBlue);
                 fodir[i]=-1;}  



////Upper Guard Rail
  if (High[i+2]>High[i+1] 
  && High[i+1]< iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+1)+FMax*10*Point+100*Point && High[i+1]> iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+1)+FMax*10*Point-20*Point
     && Close[i+1]< iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+1)+FMax*10*Point+50*Point && Low[i]<Low[i+1]
     && Low[i+2]<iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+1)+FMax*10*Point
 //    && !(Low[i+2]< iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)+FMax*10*Point+30*Point && Low[i+2]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)+FMax*10*Point-20*Point
//     && Close[i+2]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)+FMax*10*Point+50*Point && Low[i+1]>Low[i+2])
){
                ObjectCreate("Fakeiii"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+40*Point);
                 ObjectSetText("Fakeiii"+i, "F", 33, "Arial Black", clrYellow);
                 ObjectCreate("Fakerii"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+40*Point);
                 ObjectSetText("Fakerii"+i, " F", 33, "Arial Black", clrNavy);
                 fodir[i]=-1;
                 }  
                 
                 
////Upper PHaze Rail
  if (High[i+2]<High[i+1] &&
   High[i+1]< iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+1)+3*FMax*10*Point+100*Point && High[i+1]> iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+1)+3*FMax*10*Point-20*Point
     && Close[i+1]< iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+1)+3*FMax*10*Point+50*Point && Low[i+1]<Low[i+2]
     && Low[i+2]<iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i+1)+3*FMax*10*Point
     && !(Low[i+2]< iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)+3*FMax*10*Point+30*Point && Low[i+2]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)+3*FMax*10*Point-20*Point
     && Close[i+2]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)+3*FMax*10*Point+50*Point && Low[i+1]>Low[i+2])
){
                ObjectCreate("Fakeiiii"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+50*Point);
                 ObjectSetText("Fakeiiii"+i, "F", 33, "Arial Black", clrYellow);
                 ObjectCreate("Fakeriii"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+50*Point);
                 ObjectSetText("Fakeriii"+i, " F", 33, "Arial Black", clrNavy);
                 fodir[i]=-1;}                   



/////////////////////////////////


///Maroon
//High[i+2]>High[i+1] &&
 if ( Low[i+1]< iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i+1)+30*Point && Low[i+1]> iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i+1)-70*Point
     && Close[i+1]> iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i+1)-10*Point && Low[i]>Low[i+1] 
     && (High[i+2]> iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,i+2)-10*Point  || High[i+3]> iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,i+3)-10*Point )
     && !(Low[i+2]< iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i+2)+30*Point && Low[i+2]> iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i+2)-70*Point
     && Close[i+2]> iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i+2)-10*Point && Low[i+1]>Low[i+2] )
     
//    && !(Low[i+2]< iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i+2)+30*Point && Low[i+2]> iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i+2)-50*Point
//     && Close[i+2]> iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i+2)+30*Point && Low[i+1]<Low[i+2])
     
     ){
               ObjectCreate("Faken"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Faken"+i, "F", 33, "Arial Black", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Arial Black", clrYellow);
                 fodir[i]=1;}

/////2H Lema

 if (High[i]>High[i+1] && Low[i+1]< iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,i+1)+20*Point && Low[i+1]> iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,i+1)-40*Point
     && Close[i+1]> iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,i+1)+10*Point && Low[i]>Low[i+1]
     && !(Low[i+2]< iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,i+2)+20*Point && Low[i+2]> iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,i+2)-40*Point
     && Close[i+2]> iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,i+2)+50*Point && Low[i+1]>Low[i+2])){
               ObjectCreate("Faken"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Faken"+i, "F", 33, "Arial Black", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Arial Black", clrYellow);
                 fodir[i]=1;}
                 
////19872       
  if (High[i+2]>High[i+1] && Low[i+1]< iMA(symbol,30,19872,0,MODE_EMA, PRICE_LOW,i+1)+20*Point && Low[i+1]> iMA(symbol,30,19872,0,MODE_EMA, PRICE_LOW,i+1)-30*Point
     && Close[i+1]> iMA(symbol,30,19872,0,MODE_EMA, PRICE_LOW,i+1)+10*Point && Low[i]>Low[i+1]
     && !(Low[i+2]< iMA(symbol,30,19872,0,MODE_EMA, PRICE_LOW,i+2)+20*Point && Low[i+2]> iMA(symbol,30,19872,0,MODE_EMA, PRICE_LOW,i+2)-30*Point
     && Close[i+2]> iMA(symbol,30,19872,0,MODE_EMA, PRICE_LOW,i+2)+50*Point && Low[i+1]>Low[i+2])){
               ObjectCreate("Faken"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Faken"+i, "F", 33, "Arial Black", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Arial Black", clrYellow);
                 fodir[i]=1;}               
                 
/////39744
  if (Low[i+1]< iMA(symbol,30,39744,0,MODE_EMA, PRICE_LOW,i+1)+20*Point && Low[i+1]> iMA(symbol,30,39744,0,MODE_EMA, PRICE_LOW,i+1)-30*Point
     && Close[i+1]> iMA(symbol,30,39744,0,MODE_EMA, PRICE_LOW,i+1)+50*Point && Low[i]>Low[i+1]
     && !(Low[i+2]< iMA(symbol,30,39744,0,MODE_EMA, PRICE_LOW,i+2)+20*Point && Low[i+2]> iMA(symbol,30,39744,0,MODE_EMA, PRICE_LOW,i+2)-30*Point
     && Close[i+2]> iMA(symbol,30,39744,0,MODE_EMA, PRICE_LOW,i+2)+50*Point && Low[i+1]>Low[i+2])){
               ObjectCreate("Faken"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Faken"+i, "F", 33, "Arial Black", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Arial Black", clrMagenta);
                 fodir[i]=1;}                      
                 
////30m Lema      
  if (High[i+2]>High[i+1] && Low[i+1]< iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,i+1)+20*Point && Low[i+1]> iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,i+1)-30*Point
     && Close[i+1]> iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,i+1)+10*Point && High[i]>High[i+1]
     && !(Low[i+2]< iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,i+2)+20*Point && Low[i+2]> iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,i+2)-30*Point
     && Close[i+2]> iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,i+2)+10*Point && Low[i+1]>Low[i+2])){
               ObjectCreate("Faken"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Faken"+i, "F", 33, "Arial Black", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Arial Black", clrYellow);
                 fodir[i]=1;}               


////Green River     
  if (High[i+2]>High[i+1] && Low[i+1]< iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+1)-30*Point && Low[i+1]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+1)-90*Point
     && Close[i+1]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+1)+10*Point && Low[i]>Low[i+1]
     && !(Low[i+2]< iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-30*Point && Low[i+2]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-90*Point
     && Close[i+2]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)+50*Point && Low[i+1]>Low[i+2])){
               ObjectCreate("Faken"+i,OBJ_TEXT, 0, Time[i+2], Low[i+2]+10*Point);
                 ObjectSetText("Faken"+i, "F", 33, "Arial Black", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+2], Low[i+2]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Arial Black", clrYellow);
                 fodir[i]=1;} 
                 

////Lower Guard Rail
  if (Low[i+2]>Low[i+1] && Low[i+1]< iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+1)-FMax*10*Point && Low[i+1]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+1)-FMax*10*Point-60*Point
     && Close[i+1]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+1)-FMax*10*Point && Low[i]>Low[i+1]
  //   && Low[i+2]<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+1)-FMax*10*Point
     && !(Low[i+3]>Low[i+2] && Low[i+2]< iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point && Low[i+2]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point-60*Point
     && Close[i+2]> iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point && Low[i+1]>Low[i+2])
    // && (Open[i+2]>iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point  || Open[i+1]>iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i+2)-FMax*10*Point)
     ){
                 ObjectCreate("Faken"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Faken"+i, "F", 33, "Arial Black", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Arial Black", clrYellow);
                 fodir[i]=1;} 
                        
                 
   }                        
                 


}

deletetxt1("LEMA");


if (Period()==30){

///downside fake-out boxes








if (MathAbs(Open[0]-iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point)<800*Point && Open[4]>iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point)
 ObjectCreate("LEMAGRL", OBJ_RECTANGLE, 0,  Time[15], iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point-60*Point, Time[25], iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point-120*Point);
  ObjectSetInteger(0,"LEMAGRL",OBJPROP_COLOR,clrCyan);
  ObjectSet("LEMAGRL",OBJPROP_BACK,0);
  ObjectSet("LEMAGRL",OBJPROP_WIDTH,5);

if (MathAbs(Open[0]-iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,0))<800*Point && Open[4]>iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,0))
 ObjectCreate("LEMA1556L", OBJ_RECTANGLE, 0,  Time[15], iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,0)-10*Point, Time[25], iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,0)-60*Point);
  ObjectSetInteger(0,"LEMA1556L",OBJPROP_COLOR,clrCyan);
  ObjectSet("LEMA1556L",OBJPROP_BACK,0);
  ObjectSet("LEMA1556L",OBJPROP_WIDTH,5);


if (MathAbs(Open[0]-iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0))<800*Point && Open[4]>iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0))
 ObjectCreate("LEMA414L", OBJ_RECTANGLE, 0,  Time[15], iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-10*Point, Time[25], iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-60*Point);
  ObjectSetInteger(0,"LEMA414L",OBJPROP_COLOR,clrCyan);
  ObjectSet("LEMA414L",OBJPROP_BACK,0);
  ObjectSet("LEMA414L",OBJPROP_WIDTH,5);


if (MathAbs(Open[0]-iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,0))<800*Point && Open[4]>iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,0))
 ObjectCreate("LEMA828L", OBJ_RECTANGLE, 0,  Time[15], iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,0)-10*Point, Time[25], iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,0)-60*Point);
  ObjectSetInteger(0,"LEMA828L",OBJPROP_COLOR,clrCyan);
  ObjectSet("LEMA828L",OBJPROP_BACK,0);
  ObjectSet("LEMA828L",OBJPROP_WIDTH,5);


if (MathAbs(Open[0]-iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,0))<800*Point && Open[4]>iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,0))
 ObjectCreate("LEMA135L", OBJ_RECTANGLE, 0,  Time[15], iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,0)-10*Point, Time[25], iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,0)-60*Point);
  ObjectSetInteger(0,"LEMA135L",OBJPROP_COLOR,clrCyan);
  ObjectSet("LEMA135L",OBJPROP_BACK,0);
  ObjectSet("LEMA135L",OBJPROP_WIDTH,5);



///upside fake-out boxes

if (MathAbs(Open[0]-iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point)<800*Point && Open[3]<iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point)
 ObjectCreate("LEMAGRU", OBJ_RECTANGLE, 0,  Time[15], iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point+60*Point, Time[25], iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point+120*Point);
  ObjectSetInteger(0,"LEMAGRU",OBJPROP_COLOR,clrOrangeRed);
  ObjectSet("LEMAGRU",OBJPROP_BACK,0);
  ObjectSet("LEMAGRU",OBJPROP_WIDTH,5);
  

if (MathAbs(Open[0]-iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,0))<800*Point && Open[3]<iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,0))
 ObjectCreate("LEMA1556U", OBJ_RECTANGLE, 0,  Time[15], iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,0)+60*Point, Time[25], iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,0)+10*Point);
  ObjectSetInteger(0,"LEMA1556U",OBJPROP_COLOR,clrOrangeRed);
  ObjectSet("LEMA1556U",OBJPROP_BACK,0);
  ObjectSet("LEMA1556U",OBJPROP_WIDTH,5);  


if (MathAbs(Open[0]-iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0))<800*Point && Open[3]<iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0))
 ObjectCreate("LEMA414U", OBJ_RECTANGLE, 0,  Time[15], iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+60*Point, Time[25], iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+10*Point);
  ObjectSetInteger(0,"LEMA414U",OBJPROP_COLOR,clrOrangeRed);
  ObjectSet("LEMA414U",OBJPROP_BACK,0);
  ObjectSet("LEMA414U",OBJPROP_WIDTH,5);


if (MathAbs(Open[0]-iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0))<800*Point && Open[3]<iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0))
 ObjectCreate("LEMA414U", OBJ_RECTANGLE, 0,  Time[15], iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+60*Point, Time[25], iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+10*Point);
  ObjectSetInteger(0,"LEMA414U",OBJPROP_COLOR,clrOrangeRed);
  ObjectSet("LEMA414U",OBJPROP_BACK,0);
  ObjectSet("LEMA414U",OBJPROP_WIDTH,5);


if (MathAbs(Open[0]-iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,0))<800*Point && Open[3]<iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,0))
 ObjectCreate("LEMA828U", OBJ_RECTANGLE, 0,  Time[15], iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,0)+60*Point, Time[25], iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,0)+10*Point);
  ObjectSetInteger(0,"LEMA828U",OBJPROP_COLOR,clrOrangeRed);
  ObjectSet("LEMA828U",OBJPROP_BACK,0);
  ObjectSet("LEMA828U",OBJPROP_WIDTH,5);


if (MathAbs(Open[0]-iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,0))<800*Point && Open[3]<iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,0))
 ObjectCreate("LEMA135U", OBJ_RECTANGLE, 0,  Time[15], iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,0)+60*Point, Time[25], iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,0)+10*Point);
  ObjectSetInteger(0,"LEMA135U",OBJPROP_COLOR,clrOrangeRed);
  ObjectSet("LEMA135U",OBJPROP_BACK,0);
  ObjectSet("LEMA135U",OBJPROP_WIDTH,5);





}




if (plot_fluctuation_brackets){
deletetxt1("Fluct"); 
deletetxt1("Der"); 
deletetxt1("Abigail");
deletetxt1("NOBR");

n=1;  
   while (n<Bars){
      if ( RSI2[n]<44 &&  RSI2[n]< RSI2[n-1] &&  RSI2[n]< RSI2[n+1]) break;
      n++;
   }


if (n<Bars  && Period()<=240) { ObjectDelete(0,"Fluct");
     if (n<7) ObjectCreate(0,"Fluct",OBJ_TREND,0,Time[n],Low[n],Time[1],Low[n]+FSize*10*Point,0,0);
     else ObjectCreate(0,"Fluct",OBJ_TREND,0,Time[n],Low[n],Time[n-7],Low[n]+FSize*10*Point,0,0);
    ObjectSetInteger(0,"Fluct",OBJPROP_RAY_RIGHT,false);
         ObjectSet("Fluct",OBJPROP_COLOR,clrWhite);
         ObjectSet("Fluct",OBJPROP_WIDTH,1); 
       
       
                 if (n<7) ObjectCreate("Abigail"+n, OBJ_RECTANGLE, 0,  Time[8], (Low[n]+FSize*10*Point), Time[0], Low[n]+FSize*10*Point+FSize/5*10*Point);
                  else ObjectCreate("Abigail"+n, OBJ_RECTANGLE, 0,  Time[n], (Low[n]+FSize*10*Point), Time[0], Low[n]+FSize*10*Point+FSize/5*10*Point);
  ObjectSetInteger(0,"Abigail"+n,OBJPROP_COLOR,clrOrange);
  ObjectSet("Abigail"+n,OBJPROP_BACK,0);
  ObjectSet("Abigail"+n,OBJPROP_WIDTH,5);
       
       
                        if (n<7) ObjectCreate("Abigail"+o, OBJ_RECTANGLE, 0,  Time[8], (Low[n]+FSize*10*Point), Time[0], Low[n]+FSize*10*Point+FSize/5*10*Point);
                  else ObjectCreate("Abigail"+o, OBJ_RECTANGLE, 0,  Time[n], (Low[n]+FSize*10*Point), Time[0], Low[n]+FSize*10*Point+FSize/5*10*Point);
  ObjectSetInteger(0,"Abigail"+o,OBJPROP_COLOR,clrMagenta);
  ObjectSet("Abigail"+o,OBJPROP_BACK,1);
  ObjectSet("Abigail"+o,OBJPROP_WIDTH,5);
  
  
//  ObjectCreate("Abigail"+o+o, OBJ_RECTANGLE, 0,  Time[32], (Low[n]+FSize*10*Point), Time[4], Low[n]+FSize*10*Point+FSize/5*10*Point);
//  ObjectSetInteger(0,"Abigail"+o+o,OBJPROP_COLOR,clrOrange);
//  ObjectSet("Abigail"+o+o,OBJPROP_BACK,0);
//  ObjectSet("Abigail"+o+o,OBJPROP_WIDTH,5);
  
  
//       ObjectCreate("NOBR", OBJ_TEXT, 0, Time[22], (Low[n]+FSize*10*Point)+30*Point); 
//               ObjectSetText("NOBR", "NO BREAK / EXTENSION", 28, "Arial Black", clrOrange);
  
}


o=1;  
   while (o<Bars){
      if (RSI2[o]>56 && RSI2[o]>RSI2[o-1] && RSI2[o]>RSI2[o+1]) break;
      o++;
   }


if (o<Bars  && Period()<=240) { ObjectDelete(0,"Der");
   if (o<7) ObjectCreate(0,"Der",OBJ_TREND,0,Time[o],High[o],Time[1],High[o]-FSize*10*Point,0,0);
    else  ObjectCreate(0,"Der",OBJ_TREND,0,Time[o],High[o],Time[o-7],High[o]-FSize*10*Point,0,0);
    ObjectSetInteger(0,"Der",OBJPROP_RAY_RIGHT,false);
         ObjectSet("Der",OBJPROP_COLOR,clrWhite);
         ObjectSet("Der",OBJPROP_WIDTH,1); 
         
         
         if (o<7)  ObjectCreate("Abigail"+o, OBJ_RECTANGLE, 0,  Time[8], (High[o]-FSize*10*Point), Time[0], High[o]-FSize*10*Point-FSize/5*10*Point);
         else ObjectCreate("Abigail"+o, OBJ_RECTANGLE, 0,  Time[o], (High[o]-FSize*10*Point), Time[0], High[o]-FSize*10*Point-FSize/5*10*Point);
  ObjectSetInteger(0,"Abigail"+o,OBJPROP_COLOR,clrOrange);
  ObjectSet("Abigail"+o,OBJPROP_BACK,0);
  ObjectSet("Abigail"+o,OBJPROP_WIDTH,5);
  
  
           if (o<7)  ObjectCreate("Abigail"+o+n, OBJ_RECTANGLE, 0,  Time[8], (High[o]-FSize*10*Point), Time[0], High[o]-FSize*10*Point-FSize/5*10*Point);
         else ObjectCreate("Abigail"+o+n, OBJ_RECTANGLE, 0,  Time[o], (High[o]-FSize*10*Point), Time[0], High[o]-FSize*10*Point-FSize/5*10*Point);
  ObjectSetInteger(0,"Abigail"+o+n,OBJPROP_COLOR,clrLime);
  ObjectSet("Abigail"+o+n,OBJPROP_BACK,1);
  ObjectSet("Abigail"+o+n,OBJPROP_WIDTH,5);
  
//  ObjectCreate("Abigail"+o+n+o, OBJ_RECTANGLE, 0,  Time[32], (High[o]-FSize*10*Point), Time[4], High[o]-FSize*10*Point-FSize/5*10*Point);
//  ObjectSetInteger(0,"Abigail"+o+n+o,OBJPROP_COLOR,clrOrange);
 // ObjectSet("Abigail"+o+n+o,OBJPROP_BACK,0);
 // ObjectSet("Abigail"+o+n+o,OBJPROP_WIDTH,5);
  
  
//   ObjectCreate("NOBR2", OBJ_TEXT, 0, Time[22], (High[o]-FSize*10*Point)); 
//               ObjectSetText("NOBR2", "NO BREAK / EXTENSION", 28, "Arial Black", clrOrange);
  
}  
  }

deletetxt1("Pol");

if (plot_polarities){

ObjectCreate( "Pol1", OBJ_TREND, 0, Time[1], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point-90*Point,4), Time[0], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point-90*Point,4));
               ObjectSet("Pol1", OBJPROP_COLOR, clrBlack);
               ObjectSet("Pol1", OBJPROP_STYLE, 2 );
               ObjectSet("Pol1", OBJPROP_WIDTH, 3 );
               ObjectSet("Pol1",OBJPROP_RAY_RIGHT,true);
               ObjectSet("Pol1", OBJPROP_BACK, 1 );
               
               
ObjectCreate( "Pol2", OBJ_TREND, 0, Time[1], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point+90*Point,4), Time[0], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point+90*Point,4));
               ObjectSet("Pol2", OBJPROP_COLOR, clrBlack);
               ObjectSet("Pol2", OBJPROP_STYLE, 2 );
               ObjectSet("Pol2", OBJPROP_WIDTH, 3 );
               ObjectSet("Pol2",OBJPROP_RAY_RIGHT,true);
               ObjectSet("Pol2", OBJPROP_BACK, 1 );               
        
ObjectCreate( "Pol3", OBJ_TREND, 0, Time[1], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point-90*Point,4), Time[0], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point-90*Point,4));
               ObjectSet("Pol3", OBJPROP_COLOR, clrBlack);
               ObjectSet("Pol3", OBJPROP_STYLE, 2 );
               ObjectSet("Pol3", OBJPROP_WIDTH, 3 );
               ObjectSet("Pol3",OBJPROP_RAY_RIGHT,true);
               ObjectSet("Pol3", OBJPROP_BACK, 1 );        

ObjectCreate( "Pol4", OBJ_TREND, 0, Time[1], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point+90*Point,4), Time[0], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point+90*Point,4));
               ObjectSet("Pol4", OBJPROP_COLOR, clrBlack);
               ObjectSet("Pol4", OBJPROP_STYLE, 2 );
               ObjectSet("Pol4", OBJPROP_WIDTH, 3 );
               ObjectSet("Pol4",OBJPROP_RAY_RIGHT,true);
               ObjectSet("Pol4", OBJPROP_BACK, 1 );     


      ObjectCreate("Pol00", OBJ_TEXT, 0, Time[0], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point-90*Point-.0000,4)); 
               ObjectSetText("Pol00", "      + "+addon, 20, "Arial Black", clrBlack);
               
               
                ObjectCreate("Pol01", OBJ_TEXT, 0, Time[0], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point+.0004,4)); 
               ObjectSetText("Pol01", "      0 0", 20, "Arial Black", clrBlack);
               

 ObjectCreate("Pol02", OBJ_TEXT, 0, Time[0], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point+90*Point+.0008,4)); 
               ObjectSetText("Pol02", "      0 "+addon, 20, "Arial Black", clrBlack);


ObjectCreate("Pol03", OBJ_TEXT, 0, Time[0], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point-90*Point-.0000,4)); 
               ObjectSetText("Pol03", "      0 "+addon, 20, "Arial Black", clrBlack);
               
               
                ObjectCreate("Pol04", OBJ_TEXT, 0, Time[0], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point+.0004,4)); 
               ObjectSetText("Pol04", "      0 0", 20, "Arial Black", clrBlack);
               

 ObjectCreate("Pol05", OBJ_TEXT, 0, Time[0], NormalizeDouble(iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point+90*Point+.0008,4)); 
               ObjectSetText("Pol05", "      - "+addon, 20, "Arial Black", clrBlack);



}
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

bool LowComparison(int currentpos, int length)
{
  bool condition = False; 
   for(int k=currentpos; k<currentpos+length; k++)
      if (iLow(Symbol(),0,k)<iMA(Symbol(),30, 135,0,MODE_EMA, PRICE_LOW,k)-.0004) {condition=True; break;}
   return (condition);
}

bool HighComparison(int currentpos, int length)
{
  bool condition = False; 
   for(int k=currentpos; k<currentpos+length; k++)
      if (iHigh(Symbol(),0,k)>iMA(Symbol(),30,135,0,MODE_EMA, PRICE_HIGH,k)+.0004) {condition=True; break;}
   return (condition);
}


double ChoppinessIndex(int period, int bar)
  {
    double Low0 = 0, High0 = 0, Close1 = 0;
    double TrueRangeLow = 0, TrueRangeHigh = 0, TrueRangeSum = 0, Input = 0;
    double PeriodTrueRangeLow = 999999999, PeriodTrueRangeHigh = 0, PeriodTrueRange = 0;

    for(int k=bar; k<bar+period; k++)
    {
      Low0   = iLow(NULL,0,k);
      High0  = iHigh(NULL,0,k);
      Close1 = iClose(NULL,0,k+1);

      if (Low0<Close1)  TrueRangeLow  = Low0;  else TrueRangeLow  = Close1;
      if (High0>Close1) TrueRangeHigh = High0; else TrueRangeHigh = Close1;
      
      if (TrueRangeLow <PeriodTrueRangeLow)  PeriodTrueRangeLow  = TrueRangeLow;  // find true low of period
      if (TrueRangeHigh>PeriodTrueRangeHigh) PeriodTrueRangeHigh = TrueRangeHigh; // find true high of period

      TrueRangeSum += TrueRangeHigh;
      TrueRangeSum -= TrueRangeLow;
    }

    PeriodTrueRange = PeriodTrueRangeHigh - PeriodTrueRangeLow;
    if (PeriodTrueRange==0) PeriodTrueRange = MathPow(10, -12); // avoid possibility of division by zero
    Input = TrueRangeSum / PeriodTrueRange;
    return ((logN(Input, 10, MathPow(10, -12)) / logN(period, 10, MathPow(10, -12))) * 100);
  }
  

double logN(double x, double base, double epsilon)
  {
    double integer = 0.0;
    if ((x < 1) || (base < 1)) return(0);

    while (x < 1)
    {
      integer -= 1;
      x *= base;
    }
  
    while (x >= base)
    {
      integer += 1;
      x /= base;
    }
  
    double partial = 0.5;
    x *= x;
    double decimal = 0.0;

    while (partial > epsilon)
    {
      if (x >= base)
      {
        decimal += partial;
        x = x / base;
      }
      partial *= 0.5;
      x *= x;
    }
    
    return (integer + decimal);
  } 


double StdDev(int shift, int samples)
  {
  double x0=0, x1=0, x2=0;
  for (int m=0; m<samples; m++)
    {
    x0 = ExtMapBuffer[m+shift];
    x1 += x0;
    x2 += MathPow(x0,2);
    }
  return(MathSqrt((x2-(x1*x1/samples))/(samples-1))); // minimum samples is 2, enforced in the init section
}
//+------------------------------------------------------------------+

   void deletetxt1(string text){
   for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){
      string   on = ObjectName(iObj);
      if(StringFind(on, text) == 0)  ObjectDelete(on);
}  }

It started out as a mean reversion, by the far end of the bear zone 1…
…and that was a wave 1 UP…

Getting In The Groove

Getting in the groove – in my opinion – requires a lot.

You would need 2 brokers 2 hours of server time apart, to be able to have different grouping on 4h candles. A signal may show up with one broker, and not with the other.

You would need to start plotting the things that are most important, and these things can be found on the Daily, the 4H and the 30 minute charts.

Energy bands can certainly help you with gauging the possibilities.

4H/ 2H dojis’ fake outs can give you targets for example for retracements (see Cornsilk lines and the two boxes with the two fake-out numbers).

Stochastics with the right settings can help you find low risk new entries, i.e. sell the fresh 4h overbought in the daily embedded oversold (magenta stripes between the oscillator lines).

Monitoring for measuring legs and divergent legs provides you with an accurate picture of current reads. You should not be making any changes while a measuring leg is printing, exit & reverse upon a divergent leg, and only when the leg was printed entirely to prevent from false triggers.

Naming certain conditions such as I named some RSI2 sequences DDI and SD can help you remembering that a thrust is still due (with the only exception is upon having reached the end of the line – see the energy moat).

A sign of strength followed by a thrust is a peak, and you do not want to be buying until you saw 2 measuring legs printed in the opposite direction.

Invent a box with “bona fide reversal” label and put in 4h divergences with not both legs being in the overbought/oversold, and 4x 30-minute RSI2 divergences in it for starters.

Ring around the doji

//2H DOJI Lines by Macdulio
#property copyright "Copyright © 2019, Macdulio" 
#property link      "https://forexfore.blog" 
#property description "V1.0"
#property description "2H Doji Lines - "
#property description "plotting # maxlines (max 15) "
#property description "from the last 2-H dojis"
#property description "plus 2 boxes and two numbers"
#property description "around the very last two."
#include <stdlib.mqh>
#property indicator_chart_window
#property indicator_buffers 30
#property indicator_color1 Cornsilk
extern int maxlines = 8; 
extern int displaylength = 36;     
extern int       MinLengthOfUpTail=1; //candle with upper tail equal or more than this will show up
extern int       MinLengthOfLoTail=1; //candle with lower tail equal or more than this will show up
extern double    MaxLengthOfBody=30; //candle with body less or equal with this will show up
     
double pt=0.00001;
double lines[];
double mid[];

double line1[];
double line2[];
double line3[];
double line4[];
double line5[];
double line6[];
double line7[];
double line8[];
double line9[];
double line10[];
double line11[];
double line12[];
double line13[];
double line14[];
double line15[];

double vbru[];

string TimeFrame;
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexBuffer(0,line1);
   SetIndexBuffer(1,line2);
   SetIndexBuffer(2,line3);
   SetIndexBuffer(3,line4);
   SetIndexBuffer(4,line5);  
   SetIndexBuffer(5,line6);
   SetIndexBuffer(6,line7);
   SetIndexBuffer(7,line8);
   SetIndexBuffer(8,line9);
   SetIndexBuffer(9,line10);
   SetIndexBuffer(10,line11);  
   SetIndexBuffer(11,line12);   
   SetIndexBuffer(12,line13);
   SetIndexBuffer(13,line14);
   SetIndexBuffer(14,line15);  
                
   SetIndexStyle(0,DRAW_LINE,EMPTY,5,indicator_color1);
   SetIndexStyle(1,DRAW_LINE,EMPTY,5,indicator_color1);
   SetIndexStyle(2,DRAW_LINE,EMPTY,5,indicator_color1);     
   SetIndexStyle(3,DRAW_LINE,EMPTY,5,indicator_color1);
   SetIndexStyle(4,DRAW_LINE,EMPTY,5,indicator_color1);
   SetIndexStyle(5,DRAW_LINE,EMPTY,5,indicator_color1);  
   SetIndexStyle(6,DRAW_LINE,EMPTY,5,indicator_color1);
   SetIndexStyle(7,DRAW_LINE,EMPTY,5,indicator_color1);
   SetIndexStyle(8,DRAW_LINE,EMPTY,5,indicator_color1);     
   SetIndexStyle(9,DRAW_LINE,EMPTY,5,indicator_color1);
   SetIndexStyle(10,DRAW_LINE,EMPTY,5,indicator_color1);
   SetIndexStyle(11,DRAW_LINE,EMPTY,5,indicator_color1);
   SetIndexStyle(12,DRAW_LINE,EMPTY,5,indicator_color1);     
   SetIndexStyle(13,DRAW_LINE,EMPTY,5,indicator_color1);
   SetIndexStyle(14,DRAW_LINE,EMPTY,5,indicator_color1);

   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   string symbol = Symbol();
   int      i,pos,c_b=IndicatorCounted();;
  ArrayResize(lines, maxlines);
 
  ArrayInitialize(lines, 0);

  ArrayResize(line1, 100);
  ArrayInitialize(line1, 0);  
  ArrayResize(line2, 100);
  ArrayInitialize(line2, 0);  
  ArrayResize(line3, 100);
  ArrayInitialize(line3, 0);    
  ArrayResize(line4, 100);
  ArrayInitialize(line4, 0);  
  ArrayResize(line5, 100);
  ArrayInitialize(line5, 0);  
  ArrayResize(line6, 100);
  ArrayInitialize(line6, 0);  
  ArrayResize(line7, 100);
  ArrayInitialize(line7, 0);    
  ArrayResize(line8, 100);
  ArrayInitialize(line8, 0);    
  ArrayResize(line9, 100);
  ArrayInitialize(line9, 0);    
  ArrayResize(line10, 100);
  ArrayInitialize(line10, 0);  
  ArrayResize(line11, 100);
  ArrayInitialize(line11, 0);    
  ArrayResize(line12, 100);
  ArrayInitialize(line12, 0);    
  ArrayResize(line13, 100);
  ArrayInitialize(line13, 0);      
  ArrayResize(line14, 100);
  ArrayInitialize(line14, 0);  
  ArrayResize(line15, 100);
  ArrayInitialize(line15, 0);  

   
    ArrayResize(vbru, Bars);
   ArrayInitialize(vbru, 0); 
 
    ArrayResize(mid, Bars);
   ArrayInitialize(mid, 0);     
 


   pos=0;
  
 for (i=500; i>=0; i--) 
    {
    
    if (i>0 && i/2==MathRound(i/2)){
    
       if (iOpen(NULL,60,i)>iClose(NULL,60,i) &&  iHigh(NULL,60,i+1)-iClose(NULL,60,i+1)>=MinLengthOfUpTail*pt && iHigh(NULL,60,i)-iClose(NULL,60,i)>=MinLengthOfUpTail*pt && iClose(NULL,60,i+1)-iLow(NULL,60,i+1)>=MinLengthOfLoTail*pt && iClose(NULL,60,i)-iLow(NULL,60,i)>=MinLengthOfLoTail*pt && MathAbs(iOpen(NULL,60,iLowest(NULL,60,MODE_OPEN,2,i))-iClose(NULL,60,iHighest(NULL,60,MODE_CLOSE,2,i)))<=MaxLengthOfBody*pt  && vbru[i+1]==0) vbru[i]=MathAbs(iClose(NULL,60,i)+iOpen(NULL,60,i))/2;
       
        if (iOpen(NULL,60,i)<iClose(NULL,60,i) &&  iHigh(NULL,60,i+1)-iClose(NULL,60,i+1)>=MinLengthOfUpTail*pt && iHigh(NULL,60,i)-iClose(NULL,60,i)>=MinLengthOfUpTail*pt && iClose(NULL,60,i+1)-iLow(NULL,60,i+1)>=MinLengthOfLoTail*pt && iClose(NULL,60,i)-iLow(NULL,60,i)>=MinLengthOfLoTail*pt && MathAbs(iOpen(NULL,60,iLowest(NULL,60,MODE_CLOSE,2,i))-iClose(NULL,60,iHighest(NULL,60,MODE_OPEN,2,i)))<=MaxLengthOfBody*pt  && vbru[i+1]==0) vbru[i]=MathAbs(iClose(NULL,60,i)+iOpen(NULL,60,i))/2;
       
   }
     }
         


  for (i=1; i<=250; i++)
   {
        if (vbru[i]>0){  mid[pos]= vbru[i]; pos=pos+1;}
   }
    
 
deletetxt1("Happy");

i=0;
   while(i<maxlines && pos>0)        
            {
               if (i==pos) break;
               if (mid[i]!=EMPTY_VALUE) lines[i]=mid[i];
               i++;
            }

   for (i=0; i<=displaylength-1; i++) {
      if (lines[0]>0) line1[i]=lines[0];
      if (lines[1]>0) line2[i]=lines[1];
      if (lines[2]>0) line3[i]=lines[2];
      if (lines[3]>0) line4[i]=lines[3];
      if (lines[4]>0) line5[i]=lines[4];
      if (lines[5]>0) line6[i]=lines[5];
      if (lines[6]>0) line7[i]=lines[6];
      if (lines[7]>0) line8[i]=lines[7];                
      if (lines[8]>0) line9[i]=lines[8];
      if (lines[9]>0) line10[i]=lines[9]; 
      if (lines[10]>0) line11[i]=lines[10];
      if (lines[11]>0) line12[i]=lines[11];
      if (lines[12]>0) line13[i]=lines[12];
      if (lines[13]>0) line14[i]=lines[13];
      if (lines[14]>0) line15[i]=lines[14];
            
      
     if (i==6) {ObjectCreate("Happygail"+i, OBJ_RECTANGLE, 0,  Time[6], line1[i]+160*Point, Time[2], line1[i]-160*Point);
  ObjectSetInteger(0,"Happygail"+i,OBJPROP_COLOR,clrPurple);
  ObjectSet("Happygail"+i,OBJPROP_BACK,0);
  ObjectSet("Happygail"+i,OBJPROP_WIDTH,5);
  
  ObjectCreate("Happybail"+i, OBJ_RECTANGLE, 0,  Time[5], line2[i]+160*Point, Time[1], line2[i]-160*Point);
  ObjectSetInteger(0,"Happybail"+i,OBJPROP_COLOR,clrRed);
  ObjectSet("Happybail"+i,OBJPROP_BACK,0);
  ObjectSet("Happybail"+i,OBJPROP_WIDTH,5);
  
   
  if (line2[i]>line1[i]){ 
         ObjectCreate("Happydays"+iHigh(symbol,240,i), OBJ_TEXT, 0, Time[0], line2[i]+99*Point); 
         ObjectSetText("Happydays"+iHigh(symbol,240,i), DoubleToStr(NormalizeDouble(line2[i]+80*Point,4),4), 16, "Arial Black", Black);
         
         ObjectCreate("Happydays"+iLow(symbol,240,i), OBJ_TEXT, 0, Time[0], line1[i]-78*Point); 
         ObjectSetText("Happydays"+iLow(symbol,240,i), DoubleToStr(NormalizeDouble(line1[i]-80*Point,4),4), 16, "Arial Black", Black);
         }
  else { 
         ObjectCreate("Happydays"+iHigh(symbol,240,i), OBJ_TEXT, 0, Time[0], line1[i]+99*Point); 
         ObjectSetText("Happydays"+iHigh(symbol,240,i), DoubleToStr(NormalizeDouble(line1[i]+80*Point,4),4), 16, "Arial Black", Black);
         
         ObjectCreate("Happydays"+iLow(symbol,240,i), OBJ_TEXT, 0, Time[0], line2[i]-78*Point); 
         ObjectSetText("Happydays"+iLow(symbol,240,i), DoubleToStr(NormalizeDouble(line2[i]-80*Point,4),4), 16, "Arial Black", Black);
         }       
   
  }
   
}

  return(0);
}

   void deletetxt1(string text){
   for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){
      string   on = ObjectName(iObj);
      if(StringFind(on, text) == 0)  ObjectDelete(on);
}  }

The Energy Bands

The concept of the energy bands is to attribute predicting power to the current consolidation level by showing how far the price could get if it was to keep on moving in a direction – before hitting an “exhaustion”.

Since somebody had to think of this, I did.

An exhaustion would prompt a consolidation: price would have to start moving sideways, backwards or something in between.

For the last time I would mention that price cannot simply always do what it wants.

Imagine the value of these bands when you are playing options strategies, such as an iron condor. You must know where to put on your spread if you don’t want it to become a liability.

 cval[i] = (.0200/55)*adj*(ChoppinessIndex(ChoppinessPeriod,i+3)+ChoppinessIndex(ChoppinessPeriod,i+4)+ChoppinessIndex(ChoppinessPeriod,i+5))/3;

The consolidation value is derived from the mean of the 3rd, 4th and 5th, 14-sample consolidation values. The adjustment is 70%.

This value is added or subtracted from the average of the 8th, 7th and 5th high/low with an individual multiplier.

 c2[i] = (iLow(NULL,0,i+8)+iLow(NULL,0,i+7)+iLow(NULL,0,i+5))/3-cval[i]*1.28
+(VOLA-50)/10000;
double VOLA = (sqrt(252) * (log(iClose(NULL,0,0) / iClose(NULL,0,1)/5*1000)))+10;

The bands are asymmetric. How did I end up with 1.27 and 1.62 multiplier on the downside and 0.9 and 1.15 on the upside and with a 4th value thrown in for good measure, is a mystery.

What matters is that these bands are dynamic, and can land you the right idea of distance possibilities.

For instance, when the high was made, did you or did you not have the maximum likely travel distance at your hand, at that very moment?

DDI 4H

Not sure about the audience of things like these, but this is how I look at charts.

The previous up move ended in a DDIU + a thrust up

SU was the actual thrust of the DDIU registering higher than the previous one.
The move started from the other side of Mr. Maroon 4H.
The thrust’s end point fell short of the DDIU high – relative weakness.

The current down move started with a DDID + thrust down = wave 1

DDID was brief, thrust came soon after – the yellow divergence resulted in a slight undercut cca 2 pips.

…and ended with a DDID + thrust down = wave 3

this undercut made it to 25 pips ~= 3/4 fluctuation size

DDIU

RSI2[i]<95 && RSI2[i+1]>98 && RSI2[i+2]>98 && RSI2[i+3]>98

DDID

RSI2[i]>5 && RSI2[i+1]<2 && RSI2[i+2]<2 && RSI2[i+3]<2

SDU stands for screw driver up, SDD: screw driver down

(they come with their own thrusts as well normally)

Take Notes

Forget most of what you know about wave theory.

A daytime job is perfect to be able to dedicate enough brain cells to figuring out how things work.

Read the following:

Now, please show wave 1 on the following image:

The red tail was an exhaustion terminal tail. If your drawing is any different from the following, then you probably suffer from the handicapp of E.W. wanting to call everything that happens on the chart a wave.

The part between the red tail and the starting, full charge doji was merely fluctuation in the downward channel (which was parellel with the Green River).

Wave 2 was easy enough, it recharged the energy by making a cross back down through MR. Maroon. The only thing noteworthy about wave 2 is that it took out its own high point while pushing lower.

Wave 3 would show an exhaustion, and this would be new to you, but most terminal moves end in the zone between 45-41.

I would put wave 3 like that. Again, not touching wave 2 and not ending at the high point, but rather the exhaustion point.

Funny? It gets funnier. One of the returning features of a wave 4 is the beat of the ending point of wave 3.

Wave 4 recharged the energy again, and ended shy of the wick – which by the way would not exist according to E.W. for “wave 1 and wave 4 cannot overlap”. The heck they can’t.

So there you have it, wave 4 in red down and wave 5 in blue with the highlighted exhaustion tail, that took 2 hours to develop this time.

(from the notes of Wave 5)

One question that might be shaping in your head if you have been a reader of mine, is if this was a mean reversion.

The numbers on the Stochastic Bars DD were missed by 1-pip on the downside and 1-pip on the upside.

The horizontal line of course was the last Peak Trending Exhaustion.

It is a back test for sure. Was this a reset? What do you think?

On the following image you can see the starting points of the 3 pushes: the high consolidation-level areas.

The 1st push came from an out-of-oversold condition. The direction was up from the red tail earlier.

The Direction of the Queen

You already know from me that the market does not turn direction without an RSI2 divergence, and also that the divergence may be between two measuring legs (wedge) or between two shoulders (H&S).

The first, obvious piece of information is this then: the answer to where is the Queen coming from is the last divergence she made.

Divergences that happened during stochastic embedding, should be eliminated.

Example 1:

Wedge turn

The wedge turn happens between two measuring legs as mentioned before.
(The measuring legs are qualifying thrusts that register in the upper/lower third on the RSI2 HL2).

The comparison should happen on the highest/lowest prices reached and the corresponding RSI2 readings. It is important to realize, that the price highs/lows do not always coincide with the RSI2 highs/lows, so go with the readings at the “fractals”.

So, as the first example shows, the second high was achieved with a much lower RSI reading.

Now, to the most sensitive part, the anticipation. Anticipation is important, for you must be prepared for the upcoming turn in order to be able to make the necessary steps.

It is one thing seeing that the move is about to run out of juice, and start dumping your holdings especially upon seeing the resistance and the change in the angle.
It is an entirely different waiting for the turn to actually transpire before going in in the opposite direction.
This second part is incredibly hard if your vocabulary has no entry under the word: discipline. Males are by nature breachers, and bankers are doubly so.
You need to start putting yourself on the clock: knowing what time it is means to be present at the last 4h candle finishing and the new one starting to print.
So when did the turn take place in our example?
It did not happen until you had a 4h candle closing below 50% of its length after the print of the divergence.
The best entry would had been after that doji candle, on the 4h open at 1.1260 and on the 6 extra pips kick back there was an opportunity to add to the position to improve on the cost basis.

After this print the Queen’s direction was turned down.

As for some actuality:

The Queen has found a problem. Her solution might just be buying starting at 1.1136.

In conclusion, if you know what the Queen is doing, you know everything.

Picture shows the disqualified divergence in red

& this is what happened…

Day Ralio: Princi Pals

Learn to make good (compromise)
This involves taking losses voluntarily at times. I.e. for the last 2 days I could had closed out my open positions for at least 5 times for a tiny loss: the 1,500 balance would had dropped to 1,300+, but the prise would had been definitely worth it: no open positions = no drag in any direction. The next day may prompt you with a very different situation. Appreciate the value of a clean slate.

Build equity: take small trades (by distance / time duration) to be able to better the equity / balance ratio and extend on your margin rope. The lower the spread, the higher the leverage, the more edges you have. Small profits can really add up, and the 10x$10=$100 is certainly scalable.

Money management is just as hard as the other part:

Get the reading right

The main thing to concentrate on is understanding the Queens desires.
An example for misinterpretation of a divergence:
The lower low with the higher RSI2 is disqualified by the embedding: the Queen being perma oversold.

That steep rising yellow was with oversold stoch D and so I would change the colour later; breaking it was an excellent continuation entry.


Try to grasp the concept of measuring legs and divergent ones.

When the market is “supposed to be” doing something, and it does not do it, something is up, and you better put on a hedge until you figureit out or it shows you what.

A volume signal (30m) is not a signal on its own: a high print is definitely showing for some interaction, but it may be only partial unload of the holdings, and as such may not be the actual reversal point.

Volume is much more usable on a cell phone screen. The spike on the left did not reverse the price for good.

Keep an eye out for flags
Continuation patterns can keep you on the right side of the trade.

The last wave can go on forever, so if you see a 30-m doji printing after a 9-sample separation from the water line, you better go back in until a new higher high/lower low with a 4H exhaustion and look for a 30-minute red tail (which tends to appear in Bear Zone 1 / Bull Zone 1).


4H on the rampage check list

  • Is the 4h energy exhausted? (CI 7 sample < 37)
  • Have we seen a red tail? (2-4 sample 30-min burn – 3 sample mostly)
  • Have the Infantry (30 min) put up fights 3 consecutive times (RSI2 divergences)?
  • Has there been a 40-sample (30 min) lower low / higher high?
  • Has the daily fuel limit been reached? (3-day average ATR)
  • Is price in the Bear Zone 1 / Bull Zone 1?
  • Was there a volume flush?

At last, the red tail is showing.

Or was it this one?

The King, the Queen and the Infantry

King is the will.
The King has found a solution: purchasing 1.12.


He wants to find a problem now – a problem that isn’t of marital but martial nature (external).

The Queen is the deed.
The Queen defied the King by going against his will.

Your bet should be that the Queen would get her way against anything the King does. Her way is the high way, the divergent way. They reconciled ultimately after the last fight, and now they are both looking forward to what lies (up) ahead.

Yet, there is also the Infantry.
They can rebel, there might be an upheaval, and with their numbers they can overpower even the Queen by the Peasants building a fortress out of divergences.

Now the Peasants are fed up with marching and started building their strong hold by the bank of the Green River.

They are weary, in a rebellious mood and want to utilize the spark zone between Mr. Maroon and the Green River to make a statement.

One possible outcome is to win the sympathy of the Queen and with her will, they can take the King on another ride. For this, a divergent higher high would be needed from the Queen for a consent.

The other possibility is to let the Peasants have their own way and show what they can do for a bit, until the Queen manages to raise a new army where she found supporters before to eradicate all progress made by the Rebellious Infantry.

The third possibility is that the Queen manages to push back the stronghold to where she herself defied the King before. Although she is made of a female, this irrational deed would be the least likely outcome, for the memory of that fight may turn the King out, and this would not be a risk worth taking.


A little literature light here for a closure.

Kings’ Cross

A letter arrived, an ultimatum. It surprised the wise old man. 
I bet this is serious now – he wondered. Vi king is about to take over our property. I have to get some help – Thin king was thinking. Later he visited Wor king. 
“I’m busy at the moment!” – he claimed. Thin king went on. Wal king wasn’t at home. He only left a message: sorry for not being here, I’ll be back sometime, I may be in the garden. What could Thin king do? He went to the garden too. He didn’t find Wal king, but a boy who was juggling with apples. 
“Hi there, I’m Star king, the son of Jonathan the third – he introduced himself. –  Want a bite?” He explained that though he had never left the apple garden, he was willing to help defend the property, and so he signed up. 
Meanwhile Vi king got help from the mighty becoming experienced veteran, Attac king. 
Things were more serious. 
Thin king and Star king sought for more potential help. 
When they met Duc king, “I have to take diving lessons today…” – he excused himself and disappeared under the waterline. 
Smo king signed up himself. “I don’t know if my lungs will hold on, but I’m willing to help.” 
“We’ll fight!” Said the three, and so they declared war. 
It turned out to be bloody, and lasting. Though Wa king sent them a message right after he’d gotten up, he never arrived. Smo king died by senile decay. Thin king followed him: he died of old age. 
Star king could barely hold on himself, but certain sounds just in time brought him hope. The noisy Knoc king arrived accompanied by Hac king, who had just arrived back from the mountains and had picked up Hi king on his way back home, who was hitch-hiking by the road. So now there were four kings on the right side. 
“Poker!” – they said. And so they won. 
The happy ending of the story is the party the Queen of Hearts gave them, as her personal gift for defending the property. But the last dance was given away – how sad – to Roc king. 


Follow up picture

Call Me Mr. Wave 2

You are not a human being, are you – asked my coworker from me today.

No, but I know how to double an account in under 30 minutes – was my response.

The Wave 2 finder is a real thing, I coded it this evening. It kind of gives unfair advantages to the holder of the routine, and so the Power Trading competition becomes almost meaningless with this dope.

If you burden up a 1:500 leveraged account until the margin level dips just below 200, it is guaranteed that you are going to double the account on the upcoming 40+ guaranteed pips.

As the first example shows, this may not take a full hour.

Reminds me of some broker making up some Asian name to claim that one of their client made 27% that month.

These two trades, namely the one on the 25th of June and the one on the 10th of July would had yielded you 100% twice, a total of 300% compounded gains in 15 days, with a total of 20+1 hours of holding time. Do compare.

You may officially refer to me as Mr. Wave 2 effective today.