Squared

Experiment.

The idea is that a market maker closes out a block with balanced books (no excess holdings in the wrong direction), thus making a brief countermove. We are going to try to spot and plot these.

Our canes are 3 lines, the 30 sample BB Upper, Lower and Main.

On the upside: lift and square (green boxes)

I am looking for a move above the MAIN or the UPPER line on the previous 2 candles, an ascending 16 EMA, and a lower wick greater than 16 pips.

//squaring - up - BB
if (Close[i]-Low[i]>160*Point && Open[i]-Low[i]>160*Point
   && (Low[i+1]>iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_UPPER,i+1) || Low[i+2]>iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_UPPER,i+2))&& Low[i]<iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_UPPER,i)
)
{
 ObjectCreate("KAROLYIII"+DoubleToStr(i), OBJ_RECTANGLE, 0, Time[i+1], Low[i] , Time[i], Close[i]);
              ObjectSetInteger(0,"KAROLYIII"+DoubleToStr(i),OBJPROP_COLOR,clrGreen);
}
//squaring - up - S30
if (Close[i]-Low[i]>160*Point && Open[i]-Low[i]>160*Point
   && (Low[i+1]>iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_MAIN,i+1) || Low[i+2]>iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_MAIN,i+2))&& Low[i]<iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_MAIN,i)
)
{
 ObjectCreate("KAROLYIII"+DoubleToStr(i), OBJ_RECTANGLE, 0, Time[i+1], Low[i] , Time[i], Close[i]);
              ObjectSetInteger(0,"KAROLYIII"+DoubleToStr(i),OBJPROP_COLOR,clrGreen);
}

Once the plot is made, the early bird can get in on a dip below the candle close on the upper examples by 6 pips up to 16 pips.

The squaring lines are relatively safe spots to put stop losses beyond.

On the downside: crack and square (red boxes)

The downside works similarly, but instead of a separation, I am looking for a crack, then a follow-up candle that has an upper wick of 8+ pips (yes, another arbitrary number).

I added one extra condition with a combination of the 2 bands, which is a combination of the two bands when a squeeze makes a move like this possible.

//squaring - down - BB 
if (High[i]-Close[i]>80*Point && Low[i+1]<Low[i+2] && Low[i+1]<Low[i+3]
&& Close[i]>iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_LOWER,i) 
&& Low[i+1]<iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_LOWER,i+1) 
&& Low[i+3]>iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_LOWER,i+3) 

)
{
 ObjectCreate("KAROLYIII"+DoubleToStr(i), OBJ_RECTANGLE, 0, Time[i+1], High[i] , Time[i], Close[i]);
              ObjectSetInteger(0,"KAROLYIII"+DoubleToStr(i),OBJPROP_COLOR,clrRed);
}

//squaring - down - S30 
if (High[i]-Close[i]>80*Point && Low[i+1]<Low[i+2] && Low[i+1]<Low[i+3]
&& iMA(symbol,0,16,0,MODE_EMA,PRICE_MEDIAN,i)<iMA(symbol,0,16,0,MODE_EMA,PRICE_MEDIAN,i+1)
&& Close[i]>iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_MAIN,i) 
&& Low[i+1]<iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_MAIN,i+1) 
&& Low[i+3]>iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_MAIN,i+3) 

)
{
 ObjectCreate("KAROLYIII"+DoubleToStr(i), OBJ_RECTANGLE, 0, Time[i+1], High[i] , Time[i], Close[i]);
              ObjectSetInteger(0,"KAROLYIII"+DoubleToStr(i),OBJPROP_COLOR,clrRed);
}



//squaring - down - BB to S30 
if (High[i]-Close[i]>80*Point && Low[i+2]<Low[i+3] && Low[i+2]<Low[i+4]
&& iMA(symbol,0,16,0,MODE_EMA,PRICE_MEDIAN,i+1)<iMA(symbol,0,16,0,MODE_EMA,PRICE_MEDIAN,i+2)
&& Close[i]>iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_MAIN,i) 
&& Low[i+1]<iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_LOWER,i+1) 
&& Low[i+4]>iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_LOWER,i+4) 

)
{
 ObjectCreate("KAROLYIII"+DoubleToStr(i), OBJ_RECTANGLE, 0, Time[i+1], High[i] , Time[i], Close[i]);
              ObjectSetInteger(0,"KAROLYIII"+DoubleToStr(i),OBJPROP_COLOR,clrRed);
}