n= -1;
Color = IIf((High < Ref(High,n) & Low > Ref(Low,n)), colorRed , colorWhite);
Plot( Close, "Colored Price", Color, styleBar );
Red arrow pointing bar is mother bar and blue arrow pointing white bar is inside bar within motherbar range. so i'm trying to compare current bar with mother bar, if current bar is inside the range of mother bar is compare immediate previous bar but i tried to add decrements n value if code condition true but its not working don't know why. Please refer image too for better clarity
n= -1;
Color = IIf((High < Ref(High,n) & Low > Ref(Low,n)), colorRed && n= n--, colorWhite);
Plot( Close, "Colored Price", Color, styleBar );