@halcyonguy thanks for this, only question is where exactly do I put the def en = (!isnan(close) and isnan(close[-lastbars])); as I have tried multiple places in the plot and even added the and and was not able to figure it out to get it to work correctly as I don't know how to code but trying to learn a little bit.. here is what I have tried, i put the def at the end of the first Plot but still showing all numbers as I put the code in the plot.
#------------------------------------
# S T R A T N U M B E R S
#
# A study by Ramon DV. aka Pelonsax
#
# Version 1.0 8/01/20
#
# Version 2.0 8/4/20 Corrected errors in logic for scenarios
#
#------------------------------------
#------------------------------------
# DEFINE SCENARIOS
#------------------------------------
def H = high;
def L = low;
def C = close;
def O = open;
def insidebar = (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]);
def outsidebar = H > H[1] and L < L[1];
def twoup = H > H[1] and L >= L[1];
def twodown = H <= H[1] and L < L[1];
#------------------------------------
# STRAT NUMBERS
#------------------------------------
input Show_Strat_Numbers = yes;
input Show_Twos = yes;
input lastbars = 4;
plot barType = if Show_Strat_Numbers and insidebar then 1 else if Show_Strat_Numbers and outsidebar then 3 else Double.NaN;
barType.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
barType.AssignValueColor(color.WHITE);def en = (!isnan(close) and isnan(close[-lastbars]));
plot barTypeDN = if Show_Strat_Numbers and !insidebar and !outsidebar and Show_Twos and twodown then 2 else Double.NaN;
barTypeDN.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
barTypeDN.AssignValueColor(color.DOWNTICK);
plot barTypeUP = if Show_Strat_Numbers and !insidebar and !outsidebar and Show_Twos and twoup then 2 else Double.NaN;
barTypeUP.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
barTypeUP.AssignValueColor(color.UPTICK);
any help would be great.. thank you