#Credits to : SleepyZ from
https://usethinkscript.com/threads/identify-bar-just-before-a-strong-move-up-or-down.12605/
input showcloud = yes;
input percent = .1;
input change = 2.5;
#Up =====================================================================
# if the current candle is more than twice the previous's candle , current candle is green , and closes above the previous
def blastoffup = if ((high - low) > (high[1] - low[1]) * change) and
close >= open and
#close > high[1] and
close > close[1] * (1 + percent / 100) then 1 else 0;
#if it is a blastup , for green candles , I would take the close , for red candles , I would take the open
def topline = if (close[1]> open[1]) then close[1] else open[1];
#plotting the top horizontal line
#I got no idea why there is a need for hup[1] , just leave it there
def hup = if blastoffup then topline else hup[1];
#plotting higher Horizontal lines
plot hblastup = hup;
hblastup.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
hblastup.SetDefaultColor(Color.GREEN);
#when it is a blastup , the botttom line will always be the bottom of the wick
def lup = if blastoffup then low[1] else lup[1];
plot lblastup = lup;
lblastup.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
lblastup.SetDefaultColor(Color.GREEN);
AddCloud(if showcloud and hblastup then hblastup else Double.NaN, lblastup, Color.GREEN, Color.GREEN);
#Down ===============================================================
def blastoffdn = if ((high - low) > (high[1] - low[1]) * change) and
close < open and
close < close[1] * (1 + percent / 100) then 1 else 0;
def bottomline = if (close[1] < open[1] ) then close[1] else open[1];
def hdn = if blastoffdn then bottomline else hdn[1];
plot hblastdn = hdn;
hblastdn.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
hblastdn.SetDefaultColor(Color.RED);
def ldn = if blastoffdn then high[1] else ldn[1];
plot lblastdn = ldn;
lblastdn.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
lblastdn.SetDefaultColor(Color.RED);
AddCloud(if showcloud and lblastup then hblastdn else Double.NaN, lblastdn, Color.RED, Color.RED);
The concept is there , I probably only need to mess around with the definition of blastoffup and blastoffdn from here , ty sir
@SleepyZ