Consistent #4

Lesson 6

Squeeze (Audi TTM cinco)

Your edge always has a volatility factor included. Outside the bands the directional volatility goes into overdrive = Effect – is going to bring on a Counter Effect

Effect in white, Counter Effect in yellow

Inside the bands your volatility edge is the recoil, which is muted counter-directional volatility measured.

The squeeze (of the bands) is the compression of the counter directional volatility to an extreme.

At the head print the direction is already downwards. Remember, you are still looking for at least 35 pips, so 42 is rather muted. Time to get agressive here.
Once the divergent leg is printed, the direction is flipped. In white counter directional move, in yellow the tail.

//squeeze    
   if ((iBands(symbol,0,120,2,0,PRICE_MEDIAN,MODE_UPPER,i)-iBands(symbol,0,120,2,0,PRICE_MEDIAN,MODE_LOWER,i))<640*Point)
   {
         ObjectCreate("Rocket"+IntegerToString(i),OBJ_TREND,0, Time[i],iBands(symbol,0,120,2,0,PRICE_MEDIAN,MODE_UPPER,i),Time[i],iBands(symbol,0,120,2,0,PRICE_MEDIAN,MODE_UPPER,i)+200*Point);
         ObjectSet("Rocket"+IntegerToString(i),OBJPROP_COLOR,clrViolet);
         ObjectSet("Rocket"+IntegerToString(i),OBJPROP_WIDTH,6);
         ObjectSet("Rocket"+IntegerToString(i),OBJPROP_BACK,1);     
         ObjectSet("Rocket"+IntegerToString(i),OBJPROP_RAY_RIGHT,0);
         
          ObjectCreate("Rockett"+IntegerToString(i),OBJ_TREND,0, Time[i],iBands(symbol,0,120,2,0,PRICE_MEDIAN,MODE_LOWER,i),Time[i],iBands(symbol,0,120,2,0,PRICE_MEDIAN,MODE_LOWER,i)-200*Point);
         ObjectSet("Rockett"+IntegerToString(i),OBJPROP_COLOR,clrViolet);
         ObjectSet("Rockett"+IntegerToString(i),OBJPROP_WIDTH,6);
         ObjectSet("Rockett"+IntegerToString(i),OBJPROP_BACK,1);     
         ObjectSet("Rockett"+IntegerToString(i),OBJPROP_RAY_RIGHT,0);
   }

Present #2

#property copyright "Copyright © 2019, Macdulio" 
#property link      "https://forexfore.blog" 
#property description "V1.0"
#property description "Overdrive 240"
#property strict;
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Crimson
#property indicator_color2 Blue
#property indicator_color9 Tan
#define  NL    "\n"
extern int lookback = 135;
extern double zero = 6.0;
extern double hundred = 94.0;
extern double FSize=32;
double FMax = FSize*6/5;
extern bool plot_9_counts = false;
extern bool plot_zero_hundred = false;
extern bool Plot_Whoop_Bam = false;
extern bool plot_Spark_Sones = false;
extern bool plot_polarities = false;
extern bool plot_ricochets = false;
extern bool plot_losing_status = true;
extern bool plot_fluctuation_brackets = false;
extern bool plot_Maroon_fake_outs = true;
extern bool plot_continuation_divergences = true;
extern bool plot_crosses = false;

int underlowguardrail[],abovehighguardrail[]; 
int undercounter[],abovecounter[];
double diff[];
int sample=414;
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[],stoch9[];
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[],guardrailuminus[],guardrailuplus[];
  double pbrainu[],pbraind[];
   double lowest_price[];
  double highest_price[]; 
  double triu[], trid[];
  int zcount[], hcount[];
  extern int HULL = 33;  
 double brownieup[],browniedn[];
  double brownieup2[],browniedn2[];
  double HighBuffer[],HighBuffer2[];
double LowBuffer[],LowBuffer2[];
double E16PBlue[],E16PBlue2[];
double E16NRed[],E16NRed2[], E16[];
double dt14, db14, pacing;
double downcross[],upcross[];
double downcross2[],upcross2[];
double E32L[],ODU[],ODD[];
int pkdir[];
  double HULLU[], HULLD[], MHULL[], inner[], HU[], HD[];
int init()
  {
  
  
     SetIndexBuffer(0,ODU);
   SetIndexStyle(0,DRAW_LINE,2,4,DarkRed);
   SetIndexLabel(0, "Highest(" + DoubleToStr(Range_n,0)+")");

   SetIndexBuffer(1,ODD);
   SetIndexStyle(1,DRAW_LINE,2,4,DarkGreen);
   SetIndexLabel(1, "Lowest(" + DoubleToStr(Range_n,0)+")");
  
   
  
//----
   return(0);
  }


int start()
  {
   int    i,i2,j,j2 ;     
  

  double xHi[];
  double xLo[];  
  int SPRD[];  
   
  
  string symbol = Symbol();
   ArrayResize(E32L, Bars);
  ArrayInitialize(E32L,0);  
         ArrayResize(ODU, Bars);  
  ArrayInitialize(ODU, EMPTY_VALUE);   

    ArrayResize(ODD, Bars);  
  ArrayInitialize(ODD, EMPTY_VALUE);   
  
  ArrayResize(fodir, 300);
ArrayInitialize(fodir, 0);  
  ArrayResize(E16, 500);   
ArrayInitialize(E16, EMPTY_VALUE); 
  ArrayResize(E16PBlue, Bars);   
ArrayInitialize(E16PBlue, EMPTY_VALUE); 
 ArrayResize(E16NRed, Bars);   
ArrayInitialize(E16NRed, EMPTY_VALUE); 
  ArrayResize(plus, 500);   
ArrayInitialize(plus, EMPTY_VALUE); 
ArrayResize(minus, 500);   
ArrayInitialize(minus, EMPTY_VALUE);
ArrayResize(downcross, 500);   
ArrayInitialize(downcross, EMPTY_VALUE);
ArrayResize(upcross, 500);   
ArrayInitialize(upcross, EMPTY_VALUE);
ArrayResize(downcross2, 500);   
ArrayInitialize(downcross2, EMPTY_VALUE);
ArrayResize(upcross2, 500);   
ArrayInitialize(upcross2, EMPTY_VALUE);
 ArrayResize(brownieup, 202);   
ArrayInitialize(brownieup, EMPTY_VALUE);
ArrayResize(browniedn, 202);   
ArrayInitialize(browniedn, EMPTY_VALUE);
 ArrayResize(brownieup2, 202);   
ArrayInitialize(brownieup2, EMPTY_VALUE);
ArrayResize(browniedn2, 202);   
ArrayInitialize(browniedn2, 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);
  ArrayResize(diff, Bars);
  ArrayInitialize(diff, 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(guardrailuplus, Bars); 
  ArrayInitialize(guardrailuplus, EMPTY_VALUE);   
     ArrayResize(guardrailuminus, Bars); 
  ArrayInitialize(guardrailuminus, 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(zcount, 500);   
ArrayInitialize(zcount, 0); 
 ArrayResize(hcount, 500);   
ArrayInitialize(hcount, 0); 
ArrayResize(sdn, 500);   
ArrayInitialize(sdn, 0); 
ArrayResize(RSI2, Bars);
ArrayInitialize(RSI2, 0);
ArrayResize(stoch, Bars);
ArrayInitialize(stoch, 0);      
ArrayResize(stoch9, Bars);
ArrayInitialize(stoch9, 0); 
ArrayResize(pkdir, Bars);
ArrayInitialize(pkdir, 0);
 ArrayResize(undercounter, 500);   
ArrayInitialize(undercounter, 0); 
 ArrayResize(abovecounter, 500);   
ArrayInitialize(abovecounter, 0); 

 ArrayResize(underlowguardrail, 500);   
ArrayInitialize(underlowguardrail, 0); 
 ArrayResize(abovehighguardrail, 500);   
ArrayInitialize(abovehighguardrail, 0); 
//--------------------------------------------------------------------

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

int o,n;

deletetxt1("OverDrive");

for(i = lookback-32; i >= 0; i--){     
   E16NRed[i]=EMPTY_VALUE;
   E16PBlue[i]=EMPTY_VALUE;
   
   E32L[i]=iMA(NULL,0,8,0,MODE_EMA, 1,i);
   
      ODU[i]=E32L[i]+FMax*23.5*Point;
  ODD[i]=E32L[i]-FMax*22.5*Point;
   
   
   
      if (i>0 && Low[i-1]>Low[i] && Low[i]<(E32L[i]-(ODU[i]+50*Point-ODD[i])/100*42) ){
    // Low[i]<ODU[i]+50*Point-(ODU[i]+50*Point-ODD[i])/100*95      
          ObjectCreate("OverDrive2FarTT"+DoubleToStr(i), OBJ_TEXT, 0, Time[iLowest(symbol,0,MODE_LOW,4,i)], iLow(symbol,0,iLowest(symbol,0,MODE_LOW,4,i))-70*Point); 
          ObjectSetText("OverDrive2FarTT"+DoubleToStr(i), " 2Far "+DoubleToString(NormalizeDouble(iLow(symbol,0,iLowest(symbol,0,MODE_LOW,4,i)),4),4)+"    ", 15, "Impact",  White);
          
           ObjectCreate("OverDrive2Far"+DoubleToStr(i), OBJ_TEXT, 0, Time[iLowest(symbol,0,MODE_LOW,4,i)], iLow(symbol,0,iLowest(symbol,0,MODE_LOW,4,i))-70*Point); 
          ObjectSetText("OverDrive2Far"+DoubleToStr(i), "2Far "+DoubleToString(NormalizeDouble(iLow(symbol,0,iLowest(symbol,0,MODE_LOW,4,i)),4),4)+"    ", 14, "Impact",  DarkGreen);
          
         if (Low[i]<ODD[i]-50*Point){ 
          
          ObjectCreate("OverDrive2FarTTT"+DoubleToStr(i), OBJ_TEXT, 0, Time[iLowest(symbol,0,MODE_LOW,4,i)], iLow(symbol,0,iLowest(symbol,0,MODE_LOW,4,i))-170*Point); 
          ObjectSetText("OverDrive2FarTTT"+DoubleToStr(i), " EFFECT", 15, "Impact",  White);
          
           ObjectCreate("OverDrive2FarXZ"+DoubleToStr(i), OBJ_TEXT, 0, Time[iLowest(symbol,0,MODE_LOW,4,i)], iLow(symbol,0,iLowest(symbol,0,MODE_LOW,4,i))-170*Point); 
          ObjectSetText("OverDrive2FarXZ"+DoubleToStr(i), "EFFECT", 14, "Impact",  DarkGreen);
    
          }
    
    //was 76      
        if (Low[i-1]>Low[i] && Low[i+1]>Low[i] ){  
          ObjectCreate("OverDrive2FarX"+DoubleToStr(i), OBJ_TEXT, 0, Time[iLowest(symbol,0,MODE_LOW,4,i)], iMA(symbol,0,18,0,MODE_EMA, PRICE_LOW,i)); 
          ObjectSetText("OverDrive2FarX"+DoubleToStr(i), "T2->0L~"+DoubleToString(NormalizeDouble(iMA(symbol,0,18,0,MODE_EMA, PRICE_LOW,i),4),4)+"    ", 14, "Impact",  Black);
    }}
    
    if (High[i]>(E32L[i]+(ODU[i]+50*Point-ODD[i])/100*42) && i>0 && High[i-1]<High[i]  && High[i]>High[i+1]){
    //&& Close[i]<ODU[i]+50*Point-(ODU[i]+50*Point-ODD[i])/100*8 
    
        ObjectCreate("OverDrive2FarZT"+DoubleToStr(i), OBJ_TEXT, 0, Time[iHighest(symbol,0,MODE_HIGH,4,i)], iHigh(symbol,0,iHighest(symbol,0,MODE_LOW,4,i))+70*Point); 
          ObjectSetText("OverDrive2FarZT"+DoubleToStr(i), "  2Far "+DoubleToString(NormalizeDouble(iHigh(symbol,0,iHighest(symbol,0,MODE_LOW,4,i)),4),4)+"                         ", 14, "Impact",  White);
    
          ObjectCreate("OverDrive2FarZ"+DoubleToStr(i), OBJ_TEXT, 0, Time[iHighest(symbol,0,MODE_HIGH,4,i)], iHigh(symbol,0,iHighest(symbol,0,MODE_LOW,4,i))+70*Point); 
          ObjectSetText("OverDrive2FarZ"+DoubleToStr(i), "2Far "+DoubleToString(NormalizeDouble(iHigh(symbol,0,iHighest(symbol,0,MODE_LOW,4,i)),4),4)+"                         ", 14, "Impact",  Maroon);
    
    if (High[i]>ODU[i]+50*Point){
    
    ObjectCreate("OverDrive2FarZTT"+DoubleToStr(i), OBJ_TEXT, 0, Time[iHighest(symbol,0,MODE_HIGH,4,i)], iHigh(symbol,0,iHighest(symbol,0,MODE_LOW,4,i))+130*Point); 
          ObjectSetText("OverDrive2FarZTT"+DoubleToStr(i), "  EFFECT", 14, "Impact",  White);
    
          ObjectCreate("OverDrive2FarZX"+DoubleToStr(i), OBJ_TEXT, 0, Time[iHighest(symbol,0,MODE_HIGH,4,i)], iHigh(symbol,0,iHighest(symbol,0,MODE_LOW,4,i))+130*Point); 
          ObjectSetText("OverDrive2FarZX"+DoubleToStr(i), "EFFECT", 14, "Impact",  Maroon);
    }
    
    ///was 76      
        if (High[i-1]<High[i] && High[i+1]<High[i] ){     
              ObjectCreate("OverDrive2FarX"+DoubleToStr(i), OBJ_TEXT, 0, Time[iLowest(symbol,0,MODE_LOW,4,i)], iMA(symbol,0,18,0,MODE_EMA, PRICE_HIGH,i)); 
          ObjectSetText("OverDrive2FarX"+DoubleToStr(i), "T2->0L~"+DoubleToString(NormalizeDouble(iMA(symbol,0,18,0,MODE_EMA, PRICE_HIGH,i),4),4)+"    ", 14, "Impact",  Black);
    }}
   

if ( iMA(symbol,60,67,0,MODE_EMA, PRICE_CLOSE,i)<iMA(symbol,60,207,0,MODE_EMA, PRICE_CLOSE,i) && iMA(symbol,60,30,0,MODE_SMA, PRICE_CLOSE,i)<iMA(symbol,60,207,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)<iMA(symbol,60,207,0,MODE_EMA, PRICE_LOW,i) && High[i]<iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)+30*Point ) 
   E16NRed[i]=(iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)-15*Point);

else if (iMA(symbol,60,30,0,MODE_SMA, PRICE_CLOSE,i)<iMA(symbol,60,207,0,MODE_EMA, PRICE_LOW,i) && Low[i]>iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)-30*Point ) 
   E16PBlue[i]=(iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)+15*Point); 

else if (iMA(symbol,60,67,0,MODE_EMA, PRICE_LOW,i)>iMA(symbol,60,207,0,MODE_EMA, PRICE_HIGH,i) && iMA(symbol,60,16,0,MODE_SMA, PRICE_CLOSE,i)>iMA(symbol,60,207,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)>iMA(symbol,60,207,0,MODE_EMA, PRICE_LOW,i) && Low[i]>iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)-30*Point ) 
   E16PBlue[i]=(iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)+15*Point);

else if (iMA(symbol,60,67,0,MODE_EMA, PRICE_LOW,i)>iMA(symbol,60,207,0,MODE_EMA, PRICE_HIGH,i) && iMA(symbol,60,30,0,MODE_SMA, PRICE_CLOSE,i)>iMA(symbol,60,207,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)>iMA(symbol,60,207,0,MODE_EMA, PRICE_LOW,i) && High[i]<iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)+30*Point ) 
   E16NRed[i]=(iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)-15*Point);


if (iMA(symbol,60,67,0,MODE_EMA, PRICE_CLOSE,i)<iMA(symbol,60,207,0,MODE_EMA, PRICE_CLOSE,i) && iMA(symbol,60,30,0,MODE_SMA, PRICE_CLOSE,i)<iMA(symbol,60,207,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)<iMA(symbol,60,207,0,MODE_EMA, PRICE_LOW,i) && High[i]<iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)+30*Point ) 
   E16NRed[i]=(iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)-15*Point);
}




 brownieup[1]=1000;
 browniedn[1]=0.01;


i=200;

while (i>0){
browniedn[i]=browniedn[i+1];
browniedn2[i]=browniedn2[i+1];
brownieup[i]=brownieup[i+1];
brownieup2[i]=brownieup2[i+1];
if (E16PBlue[i+3]==EMPTY_VALUE && E16NRed[i+3]==EMPTY_VALUE ){
if (MathAbs(High[i]-iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i))>MathAbs(Low[i]-iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i)))  {
n=i+1;  
   while (n<201){
      if ( Low[n]<iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,n) && Low[n]< Low[n-1] &&  Low[n]< Low[n+1] &&  Low[n]< Low[n+2]) break;
      n++;
   }   
if (n<201) {brownieup[i]=brownieup2[i]=Low[n]+FSize*6/5*10*Point+20*Point;}}

else if (MathAbs(High[i]-iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i))<MathAbs(Low[i]-iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,i))) {
o=i+1;  
   while (o<Bars){
      if (High[o]>iMA(symbol,60,16,0,MODE_EMA, PRICE_CLOSE,o) && High[o]>High[o-1] && High[o]>High[o+1] && High[o]>High[o+2]) break;
      o++;
   }
if (o<201) {browniedn[i]=browniedn2[i]=High[o]-FSize*6/5*10*Point-20*Point;}}
}


i--;
}


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);

 datetime UpFractalTime_1,LowFractalTime_1,UpFractalTime_2,LowFractalTime_2,    UFT2, LFT2;
string addon;
if (embeddedoversold) addon = "-";
else if (embeddedoverbought) addon = "+";
else addon = "0";

int    nCountedBars,  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);
   E16[i]=iMA(NULL,0,32,0,MODE_EMA, PRICE_CLOSE,i);
   stoch9[i]=iStochastic(symbol,0,9,3,3,MODE_SMA,1,MODE_MAIN,i);
  diff[i] = 100 - (75 - (stoch9[i] - (88 - ChoppinessIndex(14,i)))) * .8;
}   



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; 

if (plot_crosses){

if (diff[i]<63 && diff[i+1]>63 && ChoppinessIndex(14,i)>34 && Period()==30 && iStochastic(symbol,0,9,3,3,MODE_SMA,0,MODE_SIGNAL,i+1)<80) {downcross[i]=High[i]+40*Point; downcross2[i]=High[i]+40*Point;}
//&& High[i]> )
if (diff[i]>34 && diff[i+1]<34 && ChoppinessIndex(14,i)>34 && Period()==30 && iStochastic(symbol,0,9,3,3,MODE_SMA,0,MODE_SIGNAL,i+1)>20) {upcross[i]=Low[i]-40*Point; upcross2[i]=Low[i]-40*Point;}
}

}

deletetxt1("Meat");         
         
     if (plot_Maroon_fake_outs){
              
     for (i = 200 ; i >= 1; i--) {
     
        
        if ( Low[i+1]<iMA(NULL,0,135,0,MODE_EMA, PRICE_LOW,i+1) &&  Low[i+1]>iMA(NULL,0,135,0,MODE_EMA, PRICE_LOW,i+1)-FSize/2*10*Point && Low[i]>iMA(NULL,0,135,0,MODE_EMA, PRICE_LOW,i) && Low[i+6]>iMA(NULL,0,135,0,MODE_EMA, PRICE_LOW,i+6)  )  { 
        ObjectCreate("Meat"+DoubleToStr(i)+DoubleToStr(2), OBJ_ELLIPSE, 0, Time[i+2], iMA(NULL,0,135,0,MODE_EMA, PRICE_LOW,i+1), Time[i], Low[i+1]);
        ObjectSetInteger(0,"Meat"+DoubleToStr(i)+DoubleToStr(2),OBJPROP_COLOR,clrPink);
        ObjectSetDouble(0,"Meat"+DoubleToStr(i)+DoubleToStr(2),OBJPROP_SCALE,.045);
        ObjectSet("Meat"+DoubleToStr(i)+DoubleToStr(2),OBJPROP_WIDTH,8);
        
        
        ObjectCreate("Meat"+DoubleToStr(i), OBJ_ELLIPSE, 0, Time[i+2], iMA(NULL,0,135,0,MODE_EMA, PRICE_LOW,i+1), Time[i], Low[i+1]);
        ObjectSetInteger(0,"Meat"+DoubleToStr(i),OBJPROP_COLOR,clrLime);
         ObjectSetDouble(0,"Meat"+DoubleToStr(i),OBJPROP_SCALE,.045);
        ObjectSet("Meat"+DoubleToStr(i),OBJPROP_BACK,0);
        ObjectSet("Meat"+DoubleToStr(i),OBJPROP_WIDTH,8);
        
                           ObjectCreate(0,"MeatV"+DoubleToStr(i),OBJ_TEXT,0,Time[i+5],iLow(symbol,0,iLowest(symbol,0,MODE_LOW,6,i))-20*Point);
       ObjectSetText("MeatV"+DoubleToStr(i), "CL-Breaks:"+DoubleToStr(NormalizeDouble(iLow(symbol,0,iLowest(symbol,0,MODE_LOW,6,i))-30*Point,4),4), 12, "Impact", Maroon);  
        }
        
        
  //      if ( High[i+1]>iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+1) &&  High[i+1]<(iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+1)+FSize*20*Point) && High[i]<iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i) && High[i+6]<iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+6)  )  { 
  //      ObjectCreate("Meat"+DoubleToStr(i)+DoubleToStr(1), OBJ_ELLIPSE, 0, Time[i+4], iMA(NULL,0,135,0,MODE_EMA, PRICE_HIGH,i+1), Time[i], High[i+1]);
  //      ObjectSetInteger(0,"Meat"+DoubleToStr(i)+DoubleToStr(1),OBJPROP_COLOR,clrPink);
  //      ObjectSetDouble(0,"Meat"+DoubleToStr(i)+DoubleToStr(1),OBJPROP_SCALE,.045);
  //      ObjectSet("Meat"+DoubleToStr(i)+DoubleToStr(1),OBJPROP_WIDTH,8);
        
  //      ObjectCreate("Meat"+DoubleToStr(i)+DoubleToStr(3), OBJ_ELLIPSE, 0, Time[i+2],  iMA(NULL,0,135,0,MODE_EMA, PRICE_HIGH,i+1), Time[i], High[i+1]);
  //      ObjectSetInteger(0,"Meat"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_COLOR,clrCrimson);
  //       ObjectSetDouble(0,"Meat"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_SCALE,.045);
  //      ObjectSet("Meat"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_BACK,0);
  //      ObjectSet("Meat"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_WIDTH,8);
  //      }
        
        
           if ( High[i-1]<High[i] && High[i+2]<High[i+1] && High[i+3]<High[i+2]  && High[i+1]>iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+1) &&  High[i+1]<(iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+1)+FSize*10*Point) && Low[i-1]<iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i-1) && High[i+6]<iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+6)  && High[i+7]<iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+7) && High[i+8]<iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+8) && High[i+9]<iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+9) && High[i+10]<iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+10) && High[i+11]<iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+11) )  { 
        ObjectCreate("Meat"+DoubleToStr(i)+DoubleToStr(1), OBJ_ELLIPSE, 0, Time[i+2], iMA(NULL,0,135,0,MODE_EMA, PRICE_HIGH,i+1), Time[i], High[i+1]);
        ObjectSetInteger(0,"Meat"+DoubleToStr(i)+DoubleToStr(1),OBJPROP_COLOR,clrPink);
        ObjectSetDouble(0,"Meat"+DoubleToStr(i)+DoubleToStr(1),OBJPROP_SCALE,.045);
        ObjectSet("Meat"+DoubleToStr(i)+DoubleToStr(1),OBJPROP_WIDTH,8);
        
        ObjectCreate("Meat"+DoubleToStr(i)+DoubleToStr(3), OBJ_ELLIPSE, 0, Time[i+2],  iMA(NULL,0,135,0,MODE_EMA, PRICE_HIGH,i+1), Time[i], High[i+1]);
        ObjectSetInteger(0,"Meat"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_COLOR,clrTomato);
         ObjectSetDouble(0,"Meat"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_SCALE,.045);
        ObjectSet("Meat"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_BACK,0);
        ObjectSet("Meat"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_WIDTH,8);
        
                     ObjectCreate(0,"MeatV"+DoubleToStr(i),OBJ_TEXT,0,Time[i+5],iHigh(symbol,0,iHighest(symbol,0,MODE_HIGH,6,i))+70*Point);
       ObjectSetText("MeatV"+DoubleToStr(i), "CL-Breaks:"+DoubleToStr(NormalizeDouble(iHigh(symbol,0,iHighest(symbol,0,MODE_HIGH,6,i))+30*Point,4),4), 12, "Impact", DarkGreen);  
        }
         
        }
}



deletetxt1("Rack");
deletetxt1("Silow");
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;
   
   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,414,0,MODE_EMA, PRICE_HIGH,i);
    if (i<lookback) iLo[i]=iMA(NULL,0,414,0,MODE_EMA, PRICE_LOW,i);
    if (i<lookback) iHi2[i]=iMA(NULL,0,828,0,MODE_EMA, PRICE_HIGH,i);
    if (i<lookback) iLo2[i]=iMA(NULL,0,828,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,207,0,MODE_EMA, PRICE_HIGH,i);
    if (i<lookback) iLo4[i]=iMA(NULL,0,207,0,MODE_EMA, PRICE_LOW,i);

     if (i<lookback) iHi5[i]=iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i);
    if (i<lookback) iLo5[i]=iMA(NULL,0,67,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()==60){ 
    
   guardrailu[i] =iMA(NULL,240,52,0,MODE_EMA, PRICE_HIGH,i)+FMax*10*Point;
   guardraild[i] =iMA(NULL,240,52,0,MODE_EMA, PRICE_LOW,i)-FMax*10*Point;
   
   }
   
   if (Period()==30){ 
            
    guardrailu[i] =  iMA(symbol,240,52,0,MODE_EMA, PRICE_HIGH,i)+FMax*10*Point;
    
    guardraild[i] =  iMA(symbol,240,52,0,MODE_EMA, PRICE_LOW,i)-FMax*10*Point;
    
     guardraildplus[i] =  guardraild[i]+90*Point;
     guardraildminus[i] =  guardraild[i]-90*Point;
    
     guardrailuplus[i] =  guardrailu[i]+90*Point;
     guardrailuminus[i] =  guardrailu[i]-90*Point;
    
    
    pbrainu[i] =  iMA(symbol,60,207,0,MODE_EMA, PRICE_HIGH,i)+3*FMax*10*Point;
    pbraind[i] =  iMA(symbol,60,207,0,MODE_EMA, PRICE_LOW,i)-3*FMax*10*Point;
    
 triu[i] =  iMA(symbol,240,52,0,MODE_EMA, PRICE_HIGH,i)+5*FMax*10*Point;
    trid[i] =  iMA(symbol,240,52,0,MODE_EMA, PRICE_LOW,i)-5*FMax*10*Point;}


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_Spark_Sones){

 ///Maroon Above Green River
     if ( iMA(symbol,0,67,0,MODE_EMA, PRICE_LOW,i)>iMA(symbol,0,207,0,MODE_EMA, PRICE_HIGH,i) && iMA(symbol,0,67,0,MODE_EMA, PRICE_LOW,i)-iMA(symbol,0,207,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,67,0,MODE_EMA, PRICE_HIGH,i)<iMA(symbol,0,207,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,0,207,0,MODE_EMA, PRICE_LOW,i)-iMA(symbol,0,67,0,MODE_EMA, PRICE_HIGH,i)<FSize/1.4*10*Point
            && HighComparison(i,30) == False) {HighBuffer[i]=iMA(symbol,0,207,0,MODE_EMA, PRICE_LOW,i); LowBuffer[i]=iMA(symbol,0,67,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];}}
     }

   
   }

 for (i = 200 ; i >= 0; i--) {
 if (Low[i]<guardraild[i]) underlowguardrail[i]=1;
   else underlowguardrail[i]=0;
   if (High[i]>guardrailu[i]) abovehighguardrail[i]=1;
   else abovehighguardrail[i]=0;
    if ((underlowguardrail[i]+underlowguardrail[i+1]+underlowguardrail[i+2]+underlowguardrail[i+3]+underlowguardrail[i+4]+underlowguardrail[i+5]+underlowguardrail[i+6]+underlowguardrail[i+7]+underlowguardrail[i+8]+underlowguardrail[i+9]+underlowguardrail[i+10]>1 && High[i+1]<iMA(NULL,0,67,0,MODE_EMA, PRICE_LOW,i+1)  && High[i+2]<iMA(NULL,0,67,0,MODE_EMA, PRICE_LOW,i+2)) && undercounter[i+1]<9) undercounter[i]=undercounter[i+1]+1;
    if (Low[i]<iLow(symbol,0,iLowest(symbol,0,MODE_LOW,22,i+1)) && Low[i]<guardraild[i]) undercounter[i]=0;  
    if (High[i]>iMA(NULL,0,67,0,MODE_EMA, PRICE_LOW,i)&&Low[i]<iMA(NULL,0,67,0,MODE_EMA, PRICE_LOW,i)) undercounter[i] =0;
   if ((abovehighguardrail[i]+abovehighguardrail[i+1]+abovehighguardrail[i+2]+abovehighguardrail[i+3]+abovehighguardrail[i+4]+abovehighguardrail[i+5]+abovehighguardrail[i+6]+abovehighguardrail[i+7]+abovehighguardrail[i+8]+abovehighguardrail[i+9]+abovehighguardrail[i+10]>1 && Low[i+1]>iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+2) && Low[i+1]>iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i+2) ) && abovecounter[i+1]<9) abovecounter[i]=abovecounter[i+1]+1;
  if (High[i]>iHigh(symbol,0,iHighest(symbol,0,MODE_HIGH,22,i+1)) && High[i]>guardrailu[i]) abovecounter[i]=0; 
  if (Low[i]<iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i)&&High[i]>iMA(NULL,0,67,0,MODE_EMA, PRICE_HIGH,i)) abovecounter[i] =0;
  
}


deletetxt1("Rake");
deletetxt1("Fake");
deletetxt1("ZERO");
deletetxt1("HUNDRA");
deletetxt1("Whoop");
deletetxt1("Goldberg");
deletetxt1("Meanie");

if (Period()<=60){  
for(i = 240; i >= 0; i--){     
zcount[i]=zcount[i+1];
hcount[i]=hcount[i+1];

if (RSI2[i]>5 && Low[i+1]>iMA(symbol,60,207,0,MODE_EMA,PRICE_LOW,i+1)-3*FMax*10*Point && Low[i]<iMA(symbol,60,207,0,MODE_EMA,PRICE_LOW,i)-3*FMax*10*Point){

       ObjectCreate("Meanie"+i,OBJ_TEXT, 0, Time[i], iMA(symbol,60,207,0,MODE_EMA,PRICE_HIGH,i));
                 ObjectSetText("Meanie"+i, "("+NormalizeDouble(iMA(symbol,60,207,0,MODE_EMA,PRICE_HIGH,i),4)+")", 24,"Arial Black", clrNavy);}

if (Close[i]<iMA(symbol,60,207,0,MODE_EMA,PRICE_LOW,i)-FMax*10*Point) hundred = 86; 

if (RSI2[i+1]>hundred && RSI2[i]<RSI2[i+1]){
   if (plot_zero_hundred){
               ObjectCreate("HUNDRA"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+180*Point);
                 ObjectSetText("HUNDRA"+i, "100", 53, "Impact", clrPink);
                 ObjectCreate("HUNDRAz"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+180*Point);
                 ObjectSetText("HUNDRAz"+i, " 100", 53, "Impact", clrNavy);}
               
          //       else
                  hcount[i]=hcount[i]+1;
               //   if (hcount[i]==2) zcount[i+1]==0;
                //   if (hcount[i]==3) zcount[i+1]==0;
                if (hcount[i]==3) {zcount[i]=0;}
                   if (hcount[i]>5) {hcount[i]=0; }
                 }    


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


if (Close[i]>iMA(symbol,240,52,0,MODE_EMA,PRICE_HIGH,i)+FMax*10*Point) zero = 14;


if (RSI2[i+1]<zero && RSI2[i]>RSI2[i+1]){
if (plot_zero_hundred){
               ObjectCreate("ZERO"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-5*Point);
                 ObjectSetText("ZERO"+i, "0", 53, "Impact", clrPink);
                 ObjectCreate("ZEROz"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]-5*Point);
                 ObjectSetText("ZEROz"+i, " 0", 53, "Impact", clrNavy);}
                
             //    else 
             zcount[i]=zcount[i]+1;
            //     if (zcount[i]==2) hcount[i+1]==0;
              //   if (zcount[i]==3) hcount[i+1]==0;
                if (zcount[i]==3) { hcount[i]=0;}
                  if (zcount[i]>5) {zcount[i]=0;}
                 
               //  Print("Zcount["+i+"]: "+zcount[i]);
                 }    


if (i==0 && RSI2[i]<zero ){
if (plot_zero_hundred){
               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", clrCornflowerBlue);}    }



if (Plot_Whoop_Bam){

if (hcount[i]==1 && hcount[i+1]==0 ){
               ObjectCreate("Whoop"+i,OBJ_TEXT, 0, Time[i+2], High[i+1]+150*Point);
                 ObjectSetText("Whoop"+i, "Whoop", 26, "Arial Black", clrPink);
                 ObjectCreate("Whoopi"+i,OBJ_TEXT, 0, Time[i+2], High[i+1]+150*Point);
                 ObjectSetText("Whoopi"+i, " Whoop", 26, "Arial Black", clrCornflowerBlue);}    


if (hcount[i]==2 && hcount[i+1]==1){
               ObjectCreate("Whoop"+i,OBJ_TEXT, 0, Time[i+2], High[i+1]+150*Point);
                 ObjectSetText("Whoop"+i, "Bam!", 26, "Arial Black", clrPink);
                 ObjectCreate("Whoopi"+i,OBJ_TEXT, 0, Time[i+2], High[i+1]+150*Point);
                 ObjectSetText("Whoopi"+i, " Bam!", 26, "Arial Black", clrBlue);}    

if (hcount[i]==3 && hcount[i+1]==2){
               ObjectCreate("Whoop"+i,OBJ_TEXT, 0, Time[i+2], High[i+1]+150*Point);
                 ObjectSetText("Whoop"+i, "Boogie!!", 26, "Arial Black", clrPink);
                 ObjectCreate("Whoopi"+i,OBJ_TEXT, 0, Time[i+2], High[i+1]+150*Point);
                 ObjectSetText("Whoopi"+i, " Boogie!!", 26, "Arial Black", clrMagenta);
                 
                 if (i<150){     
                  ObjectCreate("Goldbergzs"+i, OBJ_RECTANGLE, 0, Time[i+2], High[i+1]+42*Point, Time[1], High[i+1]+38*Point);
                  ObjectSetInteger(0,"Goldbergzs"+i,OBJPROP_COLOR,clrDarkRed);  
                 
                  ObjectCreate("Goldbergzss"+i, OBJ_RECTANGLE, 0, Time[i+2],  High[i+1]+162*Point, Time[1],  High[i+1]+158*Point);
                  ObjectSetInteger(0,"Goldbergzss"+i,OBJPROP_COLOR,clrDarkRed);  
                 
                 ObjectCreate("Goldbergzsssb"+i, OBJ_RECTANGLE, 0, Time[i+2],  High[i+1]+268*Point, Time[1],  High[i+1]+250*Point);
                  ObjectSetInteger(0,"Goldbergzsssb"+i,OBJPROP_COLOR,clrWhite);  
                 
                 
                 ObjectCreate("Goldbergzsss"+i, OBJ_RECTANGLE, 0, Time[i+2],  High[i+1]+264*Point, Time[1],  High[i+1]+256*Point);
                  ObjectSetInteger(0,"Goldbergzsss"+i,OBJPROP_COLOR,clrDarkRed);  
                 
                 ObjectCreate("Goldbergzssss"+i, OBJ_RECTANGLE, 0, Time[i+2],  High[i+1]+364*Point, Time[1],  High[i+1]+359*Point);
                  ObjectSetInteger(0,"Goldbergzssss"+i,OBJPROP_COLOR,clrMagenta);
                 }
            
                 
                 
                 }

if (hcount[i]==4 && hcount[i+1]==3){
               ObjectCreate("Whoop"+i,OBJ_TEXT, 0, Time[i+2], High[i+1]+150*Point);
                 ObjectSetText("Whoop"+i, "WTF!!", 26, "Arial Black", clrPink);
                 ObjectCreate("Whoopi"+i,OBJ_TEXT, 0, Time[i+2], High[i+1]+150*Point);
                 ObjectSetText("Whoopi"+i, " WTF!!", 26, "Arial Black", clrCrimson);}


if (hcount[i]==5 && hcount[i+1]==4){
               ObjectCreate("Whoop"+i,OBJ_TEXT, 0, Time[i+2], High[i+1]+150*Point);
                 ObjectSetText("Whoop"+i, "????", 26, "Arial Black", clrPink);
                 ObjectCreate("Whoopi"+i,OBJ_TEXT, 0, Time[i+2], High[i+1]+150*Point);
                 ObjectSetText("Whoopi"+i, " ????", 26, "Arial Black", clrCrimson);}



if (zcount[i]==1 && zcount[i+1]==0){
               ObjectCreate("Whoopp"+i,OBJ_TEXT, 0, Time[i+2], Low[i]+25*Point);
                 ObjectSetText("Whoopp"+i, "Whoop", 26, "Arial Black", clrPink);
                 ObjectCreate("Whooppi"+i,OBJ_TEXT, 0, Time[i+2], Low[i]+25*Point);
                 ObjectSetText("Whooppi"+i, " Whoop", 26, "Arial Black", clrCornflowerBlue);}

if (zcount[i]==2 && zcount[i+1]==1){
               ObjectCreate("Whoopp"+i,OBJ_TEXT, 0, Time[i+2], Low[i]+25*Point);
                 ObjectSetText("Whoopp"+i, "Bam!", 26, "Arial Black", clrPink);
                 ObjectCreate("Whooppi"+i,OBJ_TEXT, 0, Time[i+2], Low[i]+25*Point);
                 ObjectSetText("Whooppi"+i, " Bam!", 26, "Arial Black", clrBlue);}

if (zcount[i]==3 && zcount[i+1]==2){
               ObjectCreate("Whoopp"+i,OBJ_TEXT, 0, Time[i+2], Low[i]+25*Point);
                 ObjectSetText("Whoopp"+i, "Boogie!!", 26, "Arial Black", clrPink);
                 ObjectCreate("Whooppi"+i,OBJ_TEXT, 0, Time[i+2], Low[i]+25*Point);
                 ObjectSetText("Whooppi"+i, " Boogie!!", 26, "Arial Black", clrGreen);
            
            if (i<150){     
                  ObjectCreate("Goldbergs"+i, OBJ_RECTANGLE, 0, Time[i+2], Low[i+1]-42*Point, Time[1], Low[i+1]-38*Point);
                  ObjectSetInteger(0,"Goldbergs"+i,OBJPROP_COLOR,clrDarkGreen);  
                 
                  ObjectCreate("Goldbergss"+i, OBJ_RECTANGLE, 0, Time[i+2], Low[i+1]-162*Point, Time[1], Low[i+1]-158*Point);
                  ObjectSetInteger(0,"Goldbergss"+i,OBJPROP_COLOR,clrDarkGreen);  
                 
                 ObjectCreate("Goldbergsss"+i, OBJ_RECTANGLE, 0, Time[i+2], Low[i+1]-264*Point, Time[1], Low[i+1]-256*Point);
                  ObjectSetInteger(0,"Goldbergsss"+i,OBJPROP_COLOR,clrDarkGreen);  
                 
                 ObjectCreate("Goldbergssss"+i, OBJ_RECTANGLE, 0, Time[i+2], Low[i+1]-364*Point, Time[1], Low[i+1]-359*Point);
                  ObjectSetInteger(0,"Goldbergssss"+i,OBJPROP_COLOR,clrMagenta);
                 }
                 }
                 
if (zcount[i]==4 && zcount[i+1]==3){
               ObjectCreate("Whoopp"+i,OBJ_TEXT, 0, Time[i+2], Low[i]+25*Point);
                 ObjectSetText("Whoopp"+i, "WTF!!", 26, "Arial Black", clrPink);
                 ObjectCreate("Whooppi"+i,OBJ_TEXT, 0, Time[i+2], Low[i]+25*Point);
                 ObjectSetText("Whooppi"+i, " WTF!!", 26, "Arial Black", clrDarkGreen);}


if (zcount[i]==5 && zcount[i+1]==4){
               ObjectCreate("Whoopp"+i,OBJ_TEXT, 0, Time[i+2], Low[i]+25*Point);
                 ObjectSetText("Whoopp"+i, "????", 26, "Arial Black", clrPink);
                 ObjectCreate("Whooppi"+i,OBJ_TEXT, 0, Time[i+2], Low[i]+25*Point);
                 ObjectSetText("Whooppi"+i, " ????", 26, "Arial Black", clrDarkGreen);}
}

if (i>0 && High[i]>guardraild[i] && High[i]<guardraild[i]+90*Point && High[i+1]<High[i] && High[i-1]<High[i] && High[i+7]<guardraild[i+7]  && High[i+8]<guardraild[i+8]  && High[i+6]<guardraild[i+6]    ){
      ObjectCreate("Silow"+DoubleToStr(i)+DoubleToStr(3), OBJ_ELLIPSE, 0, Time[i+1],  High[i], Time[i-1], guardraild[i]);
       ObjectSetInteger(0,"Silow"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_COLOR,clrCrimson);
       ObjectSetDouble(0,"Silow"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_SCALE,.25);
       ObjectSet("Silow"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_BACK,1);
       ObjectSet("Silow"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_WIDTH,18);

     
       }


if (i>0 && Low[i]>guardrailu[i] && Low[i]>guardrailu[i]-90*Point && Low[i+1]>Low[i] && Low[i-1]>Low[i] && Low[i+7]>guardrailu[i+7]  && Low[i+8]>guardrailu[i+8]  && Low[i+6]>guardrailu[i+6]    ){
      ObjectCreate("Silow"+DoubleToStr(i)+DoubleToStr(3), OBJ_ELLIPSE, 0, Time[i+1], Low[i], Time[i-1], guardrailu[i]);
       ObjectSetInteger(0,"Silow"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_COLOR,clrGreen);
       ObjectSetDouble(0,"Silow"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_SCALE,.25);
       ObjectSet("Silow"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_BACK,1);
       ObjectSet("Silow"+DoubleToStr(i)+DoubleToStr(3),OBJPROP_WIDTH,18);}

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, "Impact", clrYellow);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+50*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Impact", 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, "Impact", clrYellow);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Impact", 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, "Impact", clrYellow);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Impact", 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, "Impact", clrMagenta);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Impact", 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, "Impact", clrYellow);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Impact", 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, "Impact", clrYellow);
                 ObjectCreate("Faker"+i,OBJ_TEXT, 0, Time[i+1], High[i+1]+40*Point);
                 ObjectSetText("Faker"+i, " F", 33, "Impact", 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, "Impact", clrYellow);
                 ObjectCreate("Fakeri"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+50*Point);
                 ObjectSetText("Fakeri"+i, " F", 33, "Impact", 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, "Impact", clrYellow);
                 ObjectCreate("Fakerii"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+40*Point);
                 ObjectSetText("Fakerii"+i, " F", 33, "Impact", 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, "Impact", clrYellow);
                 ObjectCreate("Fakeriii"+i,OBJ_TEXT, 0, Time[i+2], High[i+2]+50*Point);
                 ObjectSetText("Fakeriii"+i, " F", 33, "Impact", 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, "Impact", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Impact", 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, "Impact", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Impact", 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, "Impact", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Impact", 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, "Impact", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Impact", 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, "Impact", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Impact", 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, "Impact", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+2], Low[i+2]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Impact", 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, "Impact", clrBlack);
                 ObjectCreate("Fakez"+i,OBJ_TEXT, 0, Time[i+1], Low[i+1]+10*Point);
                 ObjectSetText("Fakez"+i, " F", 33, "Impact", 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,1);
  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,1);
  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,1);
  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,1);
  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,1);
  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,clrPink);
  ObjectSet("LEMAGRU",OBJPROP_BACK,1);
  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,clrPink);
  ObjectSet("LEMA1556U",OBJPROP_BACK,1);
  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,clrPink);
  ObjectSet("LEMA414U",OBJPROP_BACK,1);
  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,clrPink);
  ObjectSet("LEMA414U",OBJPROP_BACK,1);
  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,clrPink);
  ObjectSet("LEMA828U",OBJPROP_BACK,1);
  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,clrPink);
  ObjectSet("LEMA135U",OBJPROP_BACK,1);
  ObjectSet("LEMA135U",OBJPROP_WIDTH,5);





}

deletetxt1("LUNA3_");


if (plot_continuation_divergences){


 j2=0;
   while (j2<500 ){
    j=j2+3; 
      if (iFractals(Symbol(),0,MODE_LOWER,j2)) 
         while (j<j2+26){
               if (stoch[j2]<stoch[j] && iFractals(Symbol(),0,MODE_LOWER,j) && Low[j2]>=Low[j]+10*Point) break;
         j++;}
    if (iFractals(Symbol(),0,MODE_LOWER,j) && iFractals(Symbol(),0,MODE_LOWER,j2) && stoch[j2]<stoch[j]  && Low[j2]>=Low[j]+10*Point) break;
        
          j2++;}  

if (j2<500 && Low[j2]>=Low[j]+10*Point) {LowFractalTime_2=iTime(NULL, 0,j2);    LowFractalTime_1=iTime(NULL, 0,j);    }

 if (j<500 && j<j2+26)   {ObjectDelete(0,"LUNA3_2");
     ObjectCreate(0,"LUNA3_2",OBJ_TREND,0,LowFractalTime_1,Low[j],LowFractalTime_2,Low[j2]);
    ObjectSetInteger(0,"LUNA3_2",OBJPROP_RAY_RIGHT,false);
         ObjectSet("LUNA3_2",OBJPROP_COLOR,indicator_color9);
         ObjectSet("LUNA3_2",OBJPROP_WIDTH,8); 
         LFT2 = LowFractalTime_2;
    }

 i2=0;
   while (i2<500){
      i=i2+3;
      if (iFractals(Symbol(),0,MODE_UPPER,i2))     
      while (i<i2+26 ){
            if ( stoch[i2]>stoch[i] && iFractals(Symbol(),0,MODE_UPPER,i) && High[i2]<=High[i]-10*Point ) break;
         i++;}
      if (iFractals(Symbol(),0,MODE_UPPER,i)  && iFractals(Symbol(),0,MODE_UPPER,i2) && stoch[i2]>stoch[i] && High[i2]<=High[i]-10*Point) break;
               i2++;}  


if (i2<500 && High[i2]<=High[i]-10*Point) { UpFractalTime_2=iTime(NULL, 0,i2);    UpFractalTime_1=iTime(NULL, 0,i);   }
 
 
if (i<500 && i<i2+26) {   ObjectDelete(0,"LUNA3_1");
         ObjectCreate(0,"LUNA3_1",OBJ_TREND,0,UpFractalTime_1,High[i],UpFractalTime_2,High[i2]);
          ObjectSetInteger(0,"LUNA3_1",OBJPROP_RAY_RIGHT,false);
         ObjectSet("LUNA3_1",OBJPROP_COLOR,indicator_color9);
         ObjectSet("LUNA3_1",OBJPROP_WIDTH,8);
      UFT2=UpFractalTime_2;
      
      }
  
int keepj=j+1;
int keepi=i+1;

  
   j2=keepj;
   while (j2<500 ){
    j=j2+3; 
      if (iFractals(Symbol(),0,MODE_LOWER,j2)) 
         while (j<j2+26){
               if (stoch[j2]<stoch[j] && iFractals(Symbol(),0,MODE_LOWER,j) && Low[j2]>=Low[j]+10*Point) break;
         j++;}
    if (iFractals(Symbol(),0,MODE_LOWER,j) && iFractals(Symbol(),0,MODE_LOWER,j2) && stoch[j2]<stoch[j]  && Low[j2]>=Low[j]+10*Point) break;
        
          j2++;}  


if (j2<500 && Low[j2]>=Low[j]+10*Point) {LowFractalTime_2=iTime(NULL, 0,j2);    LowFractalTime_1=iTime(NULL, 0,j);    }

 if (j<500 && j<j2+26)   {ObjectDelete(0,"PUNA3_2");
     ObjectCreate(0,"PUNA3_2",OBJ_TREND,0,LowFractalTime_1,Low[j],LowFractalTime_2,Low[j2]);
    ObjectSetInteger(0,"PUNA3_2",OBJPROP_RAY_RIGHT,false);
         ObjectSet("PUNA3_2",OBJPROP_COLOR,indicator_color9);
         ObjectSet("PUNA3_2",OBJPROP_WIDTH,8); 
         LFT2 = LowFractalTime_2;     
         
}
    
 i2=keepi;
   while (i2<500){
      i=i2+3;
      if (iFractals(Symbol(),0,MODE_UPPER,i2))     
      while (i<i2+26 ){
            if ( stoch[i2]>stoch[i] && iFractals(Symbol(),0,MODE_UPPER,i) && High[i2]<=High[i]-10*Point ) break;
         i++;}
      if (iFractals(Symbol(),0,MODE_UPPER,i)  && iFractals(Symbol(),0,MODE_UPPER,i2) && stoch[i2]>stoch[i] && High[i2]<=High[i]-10*Point) break;
               i2++;}  


if (i2<500 && High[i2]<=High[i]-10*Point) { UpFractalTime_2=iTime(NULL, 0,i2);    UpFractalTime_1=iTime(NULL, 0,i);   }
 
 
if (i<500 && i<i2+26) {   ObjectDelete(0,"PUNA3_1");
         ObjectCreate(0,"PUNA3_1",OBJ_TREND,0,UpFractalTime_1,High[i],UpFractalTime_2,High[i2]);
          ObjectSetInteger(0,"PUNA3_1",OBJPROP_RAY_RIGHT,false);
         ObjectSet("PUNA3_1",OBJPROP_COLOR,indicator_color9);
         ObjectSet("PUNA3_1",OBJPROP_WIDTH,8);
      UFT2=UpFractalTime_2;
     
}

keepj=j+1;
keepi=i+1;
  
   j2=keepj;
   while (j2<500 ){
    j=j2+3; 
      if (iFractals(Symbol(),0,MODE_LOWER,j2)) 
         while (j<j2+26){
               if (stoch[j2]<stoch[j] && iFractals(Symbol(),0,MODE_LOWER,j) && Low[j2]>=Low[j]+10*Point) break;
         j++;}
    if (iFractals(Symbol(),0,MODE_LOWER,j) && iFractals(Symbol(),0,MODE_LOWER,j2) && stoch[j2]<stoch[j]  && Low[j2]>=Low[j]+10*Point) break;
        
          j2++;}  


if (j2<500 && Low[j2]>=Low[j]+10*Point) {LowFractalTime_2=iTime(NULL, 0,j2);    LowFractalTime_1=iTime(NULL, 0,j);    }

 if (j<500 && j<j2+26)   {ObjectDelete(0,"PUNA4_2");
     ObjectCreate(0,"PUNA4_2",OBJ_TREND,0,LowFractalTime_1,Low[j],LowFractalTime_2,Low[j2]);
    ObjectSetInteger(0,"PUNA4_2",OBJPROP_RAY_RIGHT,false);
         ObjectSet("PUNA4_2",OBJPROP_COLOR,indicator_color9);
         ObjectSet("PUNA4_2",OBJPROP_WIDTH,8); 
         LFT2 = LowFractalTime_2;     
        
}

 i2=keepi;
   while (i2<500){
      i=i2+3;
      if (iFractals(Symbol(),0,MODE_UPPER,i2))     
      while (i<i2+26 ){
            if ( stoch[i2]>stoch[i] && iFractals(Symbol(),0,MODE_UPPER,i) && High[i2]<=High[i]-10*Point ) break;
         i++;}
      if (iFractals(Symbol(),0,MODE_UPPER,i)  && iFractals(Symbol(),0,MODE_UPPER,i2) && stoch[i2]>stoch[i] && High[i2]<=High[i]-10*Point) break;
               i2++;}  


if (i2<500 && High[i2]<=High[i]-10*Point) { UpFractalTime_2=iTime(NULL, 0,i2);    UpFractalTime_1=iTime(NULL, 0,i);   }
 
 
if (i<500 && i<i2+26) {   ObjectDelete(0,"PUNA4_1");
         ObjectCreate(0,"PUNA4_1",OBJ_TREND,0,UpFractalTime_1,High[i],UpFractalTime_2,High[i2]);
          ObjectSetInteger(0,"PUNA4_1",OBJPROP_RAY_RIGHT,false);
         ObjectSet("PUNA4_1",OBJPROP_COLOR,indicator_color9);
         ObjectSet("PUNA4_1",OBJPROP_WIDTH,8);
      UFT2=UpFractalTime_2;
       }
}


//deletetxt1("Whoop"); 
deletetxt1("Five"); 
deletetxt1("TLNE");

if (Period()==30){  
for(i = 440; i >= 1; i--){     

//iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,i)<iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i)<iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,i) &&
if ( iMA(symbol,30,135,0,MODE_EMA, PRICE_CLOSE,i)<iMA(symbol,30,414,0,MODE_EMA, PRICE_CLOSE,i) && iMA(symbol,30,60,0,MODE_SMA, PRICE_CLOSE,i)<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i) && High[i]<iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)+30*Point ) 
   E16NRed[i]=(iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)-15*Point);
//iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,i)<iMA(symbol,30,1556,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i)<iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,30,135,0,MODE_EMA, PRICE_HIGH,i)<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i) && 
else if (iMA(symbol,30,60,0,MODE_SMA, PRICE_CLOSE,i)<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i) && Low[i]>iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)-30*Point ) 
   E16PBlue[i]=(iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)+15*Point); 
//iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,i)>iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,i) && iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i)>iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,i) && 
else if (iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i)>iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i) && iMA(symbol,30,32,0,MODE_SMA, PRICE_CLOSE,i)>iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)>iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i) && Low[i]>iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)-30*Point ) 
   E16PBlue[i]=(iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)+15*Point);
//iMA(symbol,30,828,0,MODE_EMA, PRICE_LOW,i)>iMA(symbol,30,1556,0,MODE_EMA, PRICE_HIGH,i) && iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i)>iMA(symbol,30,828,0,MODE_EMA, PRICE_HIGH,i) && 
else if (iMA(symbol,30,135,0,MODE_EMA, PRICE_LOW,i)>iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i) && iMA(symbol,30,60,0,MODE_SMA, PRICE_CLOSE,i)>iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)>iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i) && High[i]<iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)+30*Point ) 
   E16NRed[i]=(iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)-15*Point);


//iMA(symbol,30,828,0,MODE_EMA, PRICE_CLOSE,i)<iMA(symbol,30,1556,0,MODE_EMA, PRICE_CLOSE,i) && iMA(symbol,30,414,0,MODE_EMA, PRICE_CLOSE,i)<iMA(symbol,30,828,0,MODE_EMA, PRICE_CLOSE,i) && 
if (iMA(symbol,30,135,0,MODE_EMA, PRICE_CLOSE,i)<iMA(symbol,30,414,0,MODE_EMA, PRICE_CLOSE,i) && iMA(symbol,30,60,0,MODE_SMA, PRICE_CLOSE,i)<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i) && iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)<iMA(symbol,30,414,0,MODE_EMA, PRICE_LOW,i) && High[i]<iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)+30*Point ) 
   E16NRed[i]=(iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)-15*Point);


if (E16PBlue[i+3]!=EMPTY_VALUE && E16PBlue[i+6]!=EMPTY_VALUE
&& High[i+5]<pbrainu[i+5] && High[i+6]<pbrainu[i+6] && High[i+7]<pbrainu[i+7] && High[i+8]<pbrainu[i+8] && High[i+9]<pbrainu[i+9] && High[i+10]<pbrainu[i+10] && High[i+11]<pbrainu[i+11] && High[i+12]<pbrainu[i+12])
 E16PBlue2[i]=iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)-30*Point;

if (E16NRed[i+3]!=EMPTY_VALUE && E16NRed[i+6]!=EMPTY_VALUE 
&& Low[i+5]>pbraind[i+5] && Low[i+6]>pbraind[i+6] && Low[i+7]>pbraind[i+7] && Low[i+8]>pbraind[i+8] && Low[i+9]>pbraind[i+9] && Low[i+10]>pbraind[i+10] && Low[i+11]>pbraind[i+11] && Low[i+12]>pbraind[i+12]
) E16NRed2[i]=iMA(symbol,30,32,0,MODE_EMA, PRICE_CLOSE,i)+30*Point;
   


if (High[i+1]<E16[i+1] && High[i+2]<E16[i+2] && High[i+3]<E16[i+3] && High[i+4]<E16[i+4] && High[i+5]<E16[i+5] && High[i+6]<E16[i+6] && High[i+7]<E16[i+7] && High[i+8]<E16[i+8] && High[i+9]<E16[i+9] && E16NRed[i]!=EMPTY_VALUE && High[i]>E16[i]){
                 ObjectCreate("Five"+i,OBJ_TEXT, 0, Time[i], High[i]+80*Point);
                 ObjectSetText("Five"+i, "5", 53, "Impact", clrWhite);
                 ObjectCreate("Fivez"+i,OBJ_TEXT, 0, Time[i], High[i]+80*Point);
                 ObjectSetText("Fivez"+i, " 5", 53, "Impact", clrMagenta);
}


if (Low[i+1]>E16[i+1] && Low[i+2]>E16[i+2] && Low[i+3]>E16[i+3] && Low[i+4]>E16[i+4] && Low[i+5]>E16[i+5] && Low[i+6]>E16[i+6] && Low[i+7]>E16[i+7] && Low[i+8]>E16[i+8] && Low[i+9]>E16[i+9] && E16PBlue[i]!=EMPTY_VALUE && Low[i]<E16[i]){
                 ObjectCreate("Five"+i,OBJ_TEXT, 0, Time[i], High[i]-80*Point);
                 ObjectSetText("Five"+i, "5", 53, "Impact", clrWhite);
                 ObjectCreate("Fivez"+i,OBJ_TEXT, 0, Time[i], High[i]-80*Point);
                 ObjectSetText("Fivez"+i, " 5", 53, "Impact", clrGreenYellow);
}

pkdir[i]=pkdir[i+1];


/////////////4-sample end tail to the upside

  if ((Period()==30 || Period()==240)  && Low[i+4]<Low[i+5] && Low[i+4]<Low[i+3] && High[i+1]-Low[i+4]>40*Point && High[i]<High[i+1] && High[i+1]>High[i+2] && iMA(symbol,0,32,0,MODE_EMA,0,i)>iMA(NULL,0,135,0,MODE_EMA, PRICE_HIGH,i) && Close[i+1]>iMA(symbol,0,32,0,MODE_EMA,0,i+1)
  && Low[i+2]>iMA(symbol,0,32,0,MODE_EMA,0,i+2)
&& Low[i+3]>iMA(symbol,0,32,0,MODE_EMA,0,i+3)
&& Low[i+4]>iMA(symbol,0,32,0,MODE_EMA,0,i+4)
&& Low[i+5]>iMA(symbol,0,32,0,MODE_EMA,0,i+5)
&& Low[i+6]>iMA(symbol,0,32,0,MODE_EMA,0,i+6)
&& Low[i+7]>iMA(symbol,0,32,0,MODE_EMA,0,i+7)
&& Low[i+8]>iMA(symbol,0,32,0,MODE_EMA,0,i+8)
&& Low[i+9]>iMA(symbol,0,32,0,MODE_EMA,0,i+9)
//&& Low[i+10]>iMA(symbol,0,32,0,MODE_EMA,0,i+10)
&& ((ChoppinessIndex(7,i+2)<45 && ChoppinessIndex(7,i+2)>38) || ChoppinessIndex(7,i+1)<32)
&& High[i+1]>iMA(symbol,30,414,0,MODE_EMA,PRICE_HIGH,i+1)+FMax*10*Point-50*Point
   ){              
ObjectCreate(0,"TLNE2_4"+i,OBJ_TREND,0,iTime(NULL, 0,i+4),Low[i+4],iTime(NULL, 0,i+1),High[i+1]);
ObjectSetInteger(0,"TLNE2_4"+i,OBJPROP_RAY_RIGHT,false);
ObjectSet("TLNE2_4"+i,OBJPROP_STYLE,2);
ObjectSet("TLNE2_4"+i,OBJPROP_COLOR,clrRed);
ObjectSet("TLNE2_4"+i,OBJPROP_WIDTH,9);
ObjectSet("TLNE2_4"+i,OBJPROP_BACK,0);
pkdir[i]=-1;
}    


/////////////4-sample end tail through the green river


 if ((Period()==30 || Period()==240)  && High[i+1]-Low[i+4]>40*Point && High[i]<High[i+1] && High[i+1]>High[i+2] && High[i+1]>iMA(NULL,0,414,0,MODE_EMA, PRICE_HIGH,i) && Low[i+4]<iMA(NULL,0,414,0,MODE_EMA, PRICE_LOW,i)
  && Low[i+2]>iMA(symbol,0,32,0,MODE_EMA,0,i+2)
&& Low[i+3]>iMA(symbol,0,32,0,MODE_EMA,0,i+3)
&& Low[i+4]>iMA(symbol,0,32,0,MODE_EMA,0,i+4)
&& Low[i+5]>iMA(symbol,0,32,0,MODE_EMA,0,i+5)
&& ((ChoppinessIndex(7,i+1)<45 && ChoppinessIndex(7,i+1)>38) || (ChoppinessIndex(7,i+1)<32 && ChoppinessIndex(7,i+1)>28 ))
&& High[i+1]>iMA(symbol,30,414,0,MODE_EMA,PRICE_HIGH,i+1)+FMax*10*Point-50*Point
   ){              
ObjectCreate(0,"TLNE2_4N"+i,OBJ_TREND,0,iTime(NULL, 0,i+4),Low[i+4],iTime(NULL, 0,i+1),High[i+1]);
ObjectSetInteger(0,"TLNE2_4N"+i,OBJPROP_RAY_RIGHT,false);
ObjectSet("TLNE2_4N"+i,OBJPROP_STYLE,2);
ObjectSet("TLNE2_4N"+i,OBJPROP_COLOR,clrOrangeRed);
ObjectSet("TLNE2_4N"+i,OBJPROP_WIDTH,9);
ObjectSet("TLNE2_4N"+i,OBJPROP_BACK,0);

}    




/////////////3-sample end tail to the upside


      if ((Period()==30 || Period()==240) && ExtDownFractalsBuffer[i+3]!=EMPTY_VALUE && High[i+1]-Low[i+3]>40*Point && High[i]<High[i+1] && High[i+1]>High[i+2] && iMA(symbol,0,32,0,MODE_EMA,0,i)>iMA(NULL,0,135,0,MODE_EMA, PRICE_HIGH,i) && Close[i+1]>iMA(symbol,0,32,0,MODE_EMA,0,i+1)
      && Low[i+2]>iMA(symbol,0,32,0,MODE_EMA,0,i+2)
&& Low[i+3]>iMA(symbol,0,32,0,MODE_EMA,0,i+3)
&& Low[i+4]>iMA(symbol,0,32,0,MODE_EMA,0,i+4)
&& Low[i+5]>iMA(symbol,0,32,0,MODE_EMA,0,i+5)
&& Low[i+6]>iMA(symbol,0,32,0,MODE_EMA,0,i+6)
&& Low[i+7]>iMA(symbol,0,32,0,MODE_EMA,0,i+7)
&& Low[i+8]>iMA(symbol,0,32,0,MODE_EMA,0,i+8)
&& Low[i+9]>iMA(symbol,0,32,0,MODE_EMA,0,i+9)
//&& Low[i+10]>iMA(symbol,0,32,0,MODE_EMA,0,i+10)
&& ((ChoppinessIndex(7,i+1)<45 && ChoppinessIndex(7,i+1)>38) || ChoppinessIndex(7,i+1)<32)
&& High[i+1]>iMA(symbol,30,414,0,MODE_EMA,PRICE_HIGH,i+1)+FMax*10*Point-50*Point
       ){              
ObjectCreate(0,"TLNE2_4t"+i,OBJ_TREND,0,iTime(NULL, 0,i+3),Low[i+3],iTime(NULL, 0,i+1),High[i+1]);
ObjectSetInteger(0,"TLNE2_4t"+i,OBJPROP_RAY_RIGHT,false);
ObjectSet("TLNE2_4t"+i,OBJPROP_STYLE,2);
ObjectSet("TLNE2_4t"+i,OBJPROP_COLOR,clrRed);
ObjectSet("TLNE2_4t"+i,OBJPROP_WIDTH,9);
ObjectSet("TLNE2_4t"+i,OBJPROP_BACK,0);
pkdir[i]=-1;
}    

/////////////4-sample end tail to the downside


      if ((Period()==30 || Period()==240) && ExtUpFractalsBuffer[i+4]!=EMPTY_VALUE  && High[i+4]-Low[i+1]>40*Point && Low[i]>Low[i+1] && Low[i+1]<Low[i+2] && iMA(symbol,0,32,0,MODE_EMA,0,i)<iMA(NULL,0,135,0,MODE_EMA, PRICE_LOW,i) && Close[i+1]<iMA(symbol,0,32,0,MODE_EMA,0,i+1)  
      && High[i+2]<iMA(symbol,0,32,0,MODE_EMA,0,i+2)
&& High[i+3]<iMA(symbol,0,32,0,MODE_EMA,0,i+3)
&& High[i+4]<iMA(symbol,0,32,0,MODE_EMA,0,i+4)
&& High[i+5]<iMA(symbol,0,32,0,MODE_EMA,0,i+5)
&& High[i+6]<iMA(symbol,0,32,0,MODE_EMA,0,i+6)
&& High[i+7]<iMA(symbol,0,32,0,MODE_EMA,0,i+7)
&& High[i+8]<iMA(symbol,0,32,0,MODE_EMA,0,i+8)
&& High[i+9]<iMA(symbol,0,32,0,MODE_EMA,0,i+9)
&& High[i+10]<iMA(symbol,0,32,0,MODE_EMA,0,i+10)
&& ((ChoppinessIndex(7,i+1)<45 && ChoppinessIndex(7,i+1)>41) || ChoppinessIndex(7,i+1)>62)
      ){              
ObjectCreate(0,"TLNE3_4"+i,OBJ_TREND,0,iTime(NULL, 0,i+4),High[i+4],iTime(NULL, 0,i+1),Low[i+1]);
ObjectSetInteger(0,"TLNE3_4"+i,OBJPROP_RAY_RIGHT,false);
ObjectSet("TLNE3_4"+i,OBJPROP_STYLE,2);
ObjectSet("TLNE3_4"+i,OBJPROP_COLOR,clrRed);
ObjectSet("TLNE3_4"+i,OBJPROP_WIDTH,9);
ObjectSet("TLNE3_4"+i,OBJPROP_BACK,0);
pkdir[i]=1;
}    

/////////////3-sample end tail to the downside


if ((Period()==30 || Period()==240) && ExtUpFractalsBuffer[i+3]!=EMPTY_VALUE && High[i+3]-Low[i+1]>40*Point && Low[i]>Low[i+1] && Low[i+1]<Low[i+2] && iMA(symbol,0,32,0,MODE_EMA,0,i)<iMA(NULL,0,135,0,MODE_EMA, PRICE_LOW,i)  && Close[i+1]<iMA(symbol,0,32,0,MODE_EMA,0,i+1)
&& High[i+2]<iMA(symbol,0,32,0,MODE_EMA,0,i+2)
&& High[i+3]<iMA(symbol,0,32,0,MODE_EMA,0,i+3)
&& High[i+4]<iMA(symbol,0,32,0,MODE_EMA,0,i+4)
&& High[i+5]<iMA(symbol,0,32,0,MODE_EMA,0,i+5)
&& High[i+6]<iMA(symbol,0,32,0,MODE_EMA,0,i+6)
&& High[i+7]<iMA(symbol,0,32,0,MODE_EMA,0,i+7)
&& High[i+8]<iMA(symbol,0,32,0,MODE_EMA,0,i+8)
&& High[i+9]<iMA(symbol,0,32,0,MODE_EMA,0,i+9)
&& High[i+10]<iMA(symbol,0,32,0,MODE_EMA,0,i+10)
&& ((ChoppinessIndex(7,i+1)<45 && ChoppinessIndex(7,i+1)>41) || ChoppinessIndex(7,i)<30)
 ){              
ObjectCreate(0,"TLNE3_4t"+i,OBJ_TREND,0,iTime(NULL, 0,i+3),High[i+3],iTime(NULL, 0,i+1),Low[i+1]);
ObjectSetInteger(0,"TLNE3_4t"+i,OBJPROP_RAY_RIGHT,false);
ObjectSet("TLNE3_4t"+i,OBJPROP_STYLE,2);
ObjectSet("TLNE3_4t"+i,OBJPROP_COLOR,clrRed);
ObjectSet("TLNE3_4t"+i,OBJPROP_WIDTH,9);
ObjectSet("TLNE3_4t"+i,OBJPROP_BACK,0);
pkdir[i]=1;
}   



if ((Period()==30 || Period()==240) 
&& ExtUpFractalsBuffer[i+3]!=EMPTY_VALUE 
&& High[i+3]-Low[i+1]>40*Point 
&& Low[i]>Low[i+1] && Low[i+1]<Low[i+2] && iMA(symbol,0,32,0,MODE_EMA,0,i)<iMA(NULL,0,135,0,MODE_EMA, PRICE_LOW,i)  && Close[i+1]<iMA(symbol,0,32,0,MODE_EMA,0,i+1)
&& High[i+3]>iMA(symbol,0,32,0,MODE_EMA,0,i+3)
&& ChoppinessIndex(7,i+1)<35
 ){              
ObjectCreate(0,"TLNE39_4t"+i,OBJ_TREND,0,iTime(NULL, 0,i+3),High[i+3],iTime(NULL, 0,i+1),Low[i+1]);
ObjectSetInteger(0,"TLNE39_4t"+i,OBJPROP_RAY_RIGHT,false);
ObjectSet("TLNE39_4t"+i,OBJPROP_STYLE,2);
ObjectSet("TLNE39_4t"+i,OBJPROP_COLOR,clrRed);
ObjectSet("TLNE39_4t"+i,OBJPROP_WIDTH,9);
ObjectSet("TLNE39_4t"+i,OBJPROP_BACK,0);
pkdir[i]=1;
}   

/////////////2-sample almost end tail to the downside


if ((Period()==30 || Period()==240) && ExtUpFractalsBuffer[i+2]!=EMPTY_VALUE && High[i+2]-Low[i+1]>40*Point && Low[i]>Low[i+1] && Low[i+1]<Low[i+2] && iMA(symbol,0,32,0,MODE_EMA,0,i)<iMA(NULL,0,135,0,MODE_EMA, PRICE_LOW,i)  && Close[i+1]<iMA(symbol,0,32,0,MODE_EMA,0,i+1)
&& High[i+2]<iMA(symbol,0,32,0,MODE_EMA,0,i+2)
&& High[i+3]<iMA(symbol,0,32,0,MODE_EMA,0,i+3)
&& High[i+4]<iMA(symbol,0,32,0,MODE_EMA,0,i+4)
&& High[i+5]<iMA(symbol,0,32,0,MODE_EMA,0,i+5)
&& High[i+6]<iMA(symbol,0,32,0,MODE_EMA,0,i+6)
&& High[i+7]<iMA(symbol,0,32,0,MODE_EMA,0,i+7)
&& High[i+8]<iMA(symbol,0,32,0,MODE_EMA,0,i+8)
&& High[i+9]<iMA(symbol,0,32,0,MODE_EMA,0,i+9)
&& High[i+10]<iMA(symbol,0,32,0,MODE_EMA,0,i+10)
&& ChoppinessIndex(7,i+1)<45 && ChoppinessIndex(7,i+1)>41
 ){              
ObjectCreate(0,"TLNE3_4t"+i,OBJ_TREND,0,iTime(NULL, 0,i+2),High[i+3],iTime(NULL, 0,i+1),Low[i+1]);
ObjectSetInteger(0,"TLNE3_4t"+i,OBJPROP_RAY_RIGHT,false);
ObjectSet("TLNE3_4t"+i,OBJPROP_STYLE,2);
ObjectSet("TLNE3_4t"+i,OBJPROP_COLOR,clrOrangeRed);
ObjectSet("TLNE3_4t"+i,OBJPROP_WIDTH,9);
ObjectSet("TLNE3_4t"+i,OBJPROP_BACK,0);
} 


}}


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,60,207,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point-90*Point,4), Time[0], NormalizeDouble(iMA(symbol,60,207,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,60,207,0,MODE_EMA, PRICE_LOW,0)-FMax*10*Point+90*Point,4), Time[0], NormalizeDouble(iMA(symbol,60,207,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,60,207,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point-90*Point,4), Time[0], NormalizeDouble(iMA(symbol,60,207,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,60,207,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point+90*Point,4), Time[0], NormalizeDouble(iMA(symbol,60,207,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,60,207,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,60,207,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,60,207,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,60,207,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,60,207,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,60,207,0,MODE_EMA, PRICE_HIGH,0)+FMax*10*Point+90*Point+.0008,4)); 
              ObjectSetText("Pol05", "      - "+addon, 20, "Arial Black", clrBlack);



}



//Print("Brownie: "+DoubleToStr(brownie[1],4));


deletetxt1("Mulan");

if (plot_9_counts){
for (i=190; i>=0; i--) {
      if (undercounter[i]>0){
       ObjectCreate("Mulan"+i,OBJ_TEXT, 0, Time[i], Low[i]-30*Point);
       ObjectSetText("Mulan"+i, IntegerToString(undercounter[i]), 13, "Arial Black", clrBlack);
//       ObjectCreate("Tekto"+i,OBJ_TEXT, 0, Time[i], Low[i]+20*Point);
 //      ObjectSetText("Tekto"+i, "3", 53, "Arial Black", clrRed);}
     if (undercounter[i]==9) {
             ObjectCreate("Mulanaw"+i,OBJ_TEXT, 0, Time[i], High[i]+40*Point);
             if (iOpen(symbol,0,iHighest(symbol,0,MODE_OPEN,9,i))>iClose(symbol,0,iHighest(symbol,0,MODE_CLOSE,9,i)))
             ObjectSetText("Mulanaw"+i, "Go Short ONLY Below: "+DoubleToString(NormalizeDouble(iOpen(symbol,0,iHighest(symbol,0,MODE_OPEN,9,i)),4),4), 23, "Arial Black", clrCrimson);
             else  ObjectSetText("Mulanaw"+i, "Go Short ONLY Below: "+DoubleToString(NormalizeDouble(iClose(symbol,0,iHighest(symbol,0,MODE_CLOSE,9,i)),4),4), 23, "Arial Black", clrCrimson);
         }
 
 }
       
   if (abovecounter[i]>0){
      ObjectCreate("Mulana"+i,OBJ_TEXT, 0, Time[i], High[i]+40*Point);
       ObjectSetText("Mulana"+i, IntegerToString(abovecounter[i]), 13, "Arial Black", clrBlue);
         
         if (abovecounter[i]==9) {
             ObjectCreate("Mulanaw"+i,OBJ_TEXT, 0, Time[i], Low[i]-40*Point);
             if (iOpen(symbol,0,iLowest(symbol,0,MODE_OPEN,9,i))<iClose(symbol,0,iLowest(symbol,0,MODE_CLOSE,9,i)))
             ObjectSetText("Mulanaw"+i, "Go Long ONLY Above: "+DoubleToString(NormalizeDouble(iOpen(symbol,0,iLowest(symbol,0,MODE_OPEN,9,i)),4),4), 23, "Arial Black", clrBlue);
             else  ObjectSetText("Mulanaw"+i, "Go Long ONLY Above: "+DoubleToString(NormalizeDouble(iClose(symbol,0,iLowest(symbol,0,MODE_CLOSE,9,i)),4),4), 23, "Arial Black", clrBlue);
         }
 //      ObjectCreate("Tekto"+i,OBJ_TEXT, 0, Time[i], High[i]+20*Point);
  //     ObjectSetText("Tekto"+i, "3", 53, "Arial Black", clrRed);}
}       
}
}   
//----
   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);
}  }
How Many Times will I regret the chances taken?
Edges are there to be used. Let them be non-Fibonacci based projected distance values (extension fills) or 216-sample 2.5 SD BB on the hourly breached for the first time for a long yime.