The Pig in the Sky & the Utmost Condition

The pig is an RSI2 divergence that remains untouched. This is bet the farm condition #1.

Yes, it is an embedded oversold market, thus we need to look above to find the starting point of the down move.

The pig is the pink/purple rectangle by the overbought neckline on the image.

The first number is the 1.3x daily true range deducted from the last 15-minute closing value where the 12- sample fractal energy crossed above 53.

```  i=0;
while (!(ChoppinessIndex(12*4,i+1)<53 && ChoppinessIndex(12*4,i)>53))
i++;

Close15 = iClose(NULL,15,i);
```

Finding the pig:

```i2=0;
while (i2<500){
i=i2+2;
if (ExtUpFractalsBuffer[i2]!=EMPTY_VALUE)
while (i<i2+26 ){
if ( RSI2[i2]<RSI2[i] && iFractals(Symbol(),0,MODE_UPPER,i) && High[i2]>=High[i]+10*Point ) break;
i++;}
if (ExtUpFractalsBuffer[i]!=EMPTY_VALUE  && ExtUpFractalsBuffer[i2]!=EMPTY_VALUE && RSI2[i2]<RSI2[i] && High[i2]>=High[i]+10*Point ) break;
i2++;}

if (ExtUpFractalsBuffer[i]!=EMPTY_VALUE  && ExtUpFractalsBuffer[i2]!=EMPTY_VALUE &&  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,"HNNN3_1");
ObjectCreate(0,"HNNN3_1",OBJ_TREND,0,UpFractalTime_1,High[i],UpFractalTime_2,High[i2]);
ObjectSetInteger(0,"HNNN3_1",OBJPROP_RAY_RIGHT,false);
ObjectSet("HNNN3_1",OBJPROP_COLOR,indicator_color8);
ObjectSet("HNNN3_1",OBJPROP_WIDTH,8);
UFT2=UpFractalTime_2;
if (plot_divergence_labels){
ObjectCreate("elixir 40"+High[i2], OBJ_TEXT, 0, Time[i2], High[i2]+FSize*1.5*Point);
ObjectSetText("elixir 40"+High[i2], "Rev/DVG", 22, "Tahoma", White);}

k=1;
while (k<i2-1) {
if (High[k]>High[i])  break;
k++;  }

if (k>i2-2) {
ObjectCreate("Virgin"+i, OBJ_RECTANGLE, 0,  Time[i2], High[i], Time[1], High[i2]);
ObjectSetInteger(0,"Virgin"+i,OBJPROP_COLOR,clrPink);
ObjectSet("Virgin"+i,OBJPROP_BACK,0);
ObjectSet("Virgin"+i,OBJPROP_WIDTH,8);
}
```

```ObjectCreate("Virgin__"+i, OBJ_TEXT, 0, Time[i2-2], High[i2]);
ObjectSetText("Virgin__"+i, "P/"+NormalizeDouble(Close15-ATRAVG[1]*1.3,4)+", "+NormalizeDouble(Close15-ATRAVG[1]*1.3-FSize/2*10*Point,4) ,28, "Arial Black", Black);
```

The second number is the estimated location of the no break extension – FSize is still 32.

The utmost condition is a White Stripe and an RSI2 divergence. This is bet the farm condition #2.

The White Stripe is the End of a Stochastic Bar Overdrive sequence.

Stochastic bar calculation with elimination of values above the lower guard rail:

```extern int    K_Period  = 25;
extern int    K_Period2  = 60;
extern int    K_Period3  = 100;
extern int    D_Period  = 3;
extern int    Slowing  = 3;
extern int    TopBorder=90;
extern int    BotBorder=10;
extern int    BotBorder2=5;
extern int    BotBorder3=3;

for(i = 550; i >= 0; i--)
{

double St=iStochastic(NULL,0,K_Period,D_Period,Slowing,MAType,PriceType,MODE_MAIN,i);
double St2=iStochastic(NULL,0,K_Period2,D_Period,Slowing,MAType,PriceType,MODE_MAIN,i);
double St3=iStochastic(NULL,0,K_Period3,D_Period,Slowing,MAType,PriceType,MODE_MAIN,i);
ExtMapBuffer2[i] = EMPTY_VALUE;
ExtMapBuffer3[i] = EMPTY_VALUE;
if (St2<BotBorder2 && (St<BotBorder || St3<BotBorder3)) ExtMapBuffer2[i] = 15;
if (St>TopBorder && !((High[i]-iMA(symbol,30,414,0,MODE_EMA, PRICE_HIGH,i))<FSize*10*Point && embeddedoversold)) ExtMapBuffer3[i] = 85;}
```

White stripe plot

```   if ((ExtMapBuffer3[i+1]==85 && ExtMapBuffer3[i]!=85) || (ExtMapBuffer2[i+1]==15 && ExtMapBuffer2[i]!=15)  ) {
ObjectCreate("Utmost"+i, OBJ_RECTANGLE, 0,  Time[i+2], iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,262,i)), Time[i], iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,262,i) ));
ObjectSetInteger(0,"Utmost"+i,OBJPROP_COLOR,clrWhite);
ObjectSet("Utmost"+i,OBJPROP_BACK,1);
ObjectSet("Utmost"+i,OBJPROP_WIDTH,5);
}
```

Modified Fractals for 30 minute

``` int    nCountedBars;
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--;
}
```