In MT4 you cannot have the same routine make continuous plots both in the chart window and in an indicator window.
This is why I had to make this duplicate alter ego, since I wanted the statistical buy / sell level plotted at all times.
Now you have no choice but to rejoyce.
Here’s the buy, where it all happens.

After the buy, the bigger stretches are the entries, say 50 or more in the negative or the 3rd purple print arrives. The Run Up is on until the second Green print appears. As mentioned before, a full body outside the Bollinger diqualifies the counter for the first count. After the close of Green 2, the market is in the correction, down to the joyce line. Similarly, the get in is the 50+ stretch of the 2nd purple close.

#property copyright "Copyright © 2023, Macdulio"
#property link "https://forexfore.blog"
#property description "V1.0"
#property description "Counter Rejoyce"
#property description "8-sample stretch from the 8-EMA band"
#property strict
//--- indicator settings
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 clrDeepPink
#property indicator_color2 clrPurple
extern int lookback = 1000;
extern int sample = 8;
double corr[],corr2[];
string symbol = Symbol();
double ExtATRBuffer[],ExtATRBuffer2[],ExtATRBuffer3[],ExtATRBuffer4[],ExtATRBuffer5[];
int init(){
SetIndexBuffer(0,corr);
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,4,indicator_color1);
SetIndexBuffer(1,corr2);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,4,indicator_color2);
return(0);
}
//+------------------------------------------------------------------+
//| Average True Range |
//+------------------------------------------------------------------+
int start(){
ArrayResize(ExtATRBuffer, Bars);
ArrayInitialize(ExtATRBuffer, EMPTY_VALUE);
ArrayResize(ExtATRBuffer2, Bars);
ArrayInitialize(ExtATRBuffer2, EMPTY_VALUE);
ArrayResize(ExtATRBuffer3, Bars);
ArrayInitialize(ExtATRBuffer3, EMPTY_VALUE);
ArrayResize(ExtATRBuffer4, Bars);
ArrayInitialize(ExtATRBuffer4, EMPTY_VALUE);
ArrayResize(ExtATRBuffer5, Bars);
ArrayInitialize(ExtATRBuffer5, EMPTY_VALUE);
ArrayResize(corr, Bars);
ArrayInitialize(corr, EMPTY_VALUE);
ArrayResize(corr2, Bars);
ArrayInitialize(corr2, EMPTY_VALUE);
int i;
for(i=lookback; i>=0; i--){
ExtATRBuffer[i]= -1*(iHigh(symbol,0,iHighest(symbol,0,MODE_HIGH,sample-1,i+1))-Low[i])*10000;
if (ExtATRBuffer[i]<-80) ExtATRBuffer[i]=-80;
ExtATRBuffer2[i]=(High[i]-iLow(symbol,0,iLowest(symbol,0,MODE_LOW,sample-1,i+1)))*10000;
if (ExtATRBuffer2[i]>80) ExtATRBuffer2[i]=80;
if (ExtATRBuffer[i]<-58) ExtATRBuffer3[i]=ExtATRBuffer[i];
else if (ExtATRBuffer2[i]>58) ExtATRBuffer3[i]=ExtATRBuffer2[i];
if (High[i]>iBands(symbol,0,216,1.8,0,PRICE_MEDIAN,MODE_UPPER,i) && (iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_UPPER,i)-iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_LOWER,i)>1100*Point || Low[i]>iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_UPPER,i)) && ExtATRBuffer3[i]>0) ExtATRBuffer4[i]=ExtATRBuffer3[i];
if (Low[i]<iBands(symbol,0,216,1.8,0,PRICE_MEDIAN,MODE_LOWER,i) && (iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_UPPER,i)-iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_LOWER,i)>1100*Point || High[i]<iBands(symbol,0,30,2,0,PRICE_MEDIAN,MODE_LOWER,i)) && ExtATRBuffer3[i]<0) ExtATRBuffer5[i]=ExtATRBuffer3[i];
}
for(i=lookback; i>=0; i--){
corr[i]=corr[i+1];
corr2[i]=corr2[i+1];
if (ExtATRBuffer4[i+6]!=EMPTY_VALUE) {corr[i]=iHigh(symbol,0,iHighest(symbol,0,MODE_HIGH,60,i))-1360*Point; corr2[i]=iHigh(symbol,0,iHighest(symbol,0,MODE_HIGH,60,i))-2200*Point;}
if (ExtATRBuffer5[i+6]!=EMPTY_VALUE) {corr[i]=iLow(symbol,0,iLowest(symbol,0,MODE_LOW,60,i))+1360*Point; corr2[i]=iLow(symbol,0,iLowest(symbol,0,MODE_LOW,60,i))+2200*Point;}
}
return(0);
}
//+------------------------------------------------------------------+
void deletetxt1(string text){
for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){
string on = ObjectName(iObj);
if(StringFind(on, text) == 0) ObjectDelete(on);
} }

