INSIDE BAR scanner and marker

can some one please provide an AFL to scan and mark insidebar formation

ie

if HIGH and LOW of present candle lies within the HIGH and LOW of previous candle

Thanks in advacne

1 Like

For the above given condition check the below coded AFL

_SECTION_BEGIN("HighLow");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
Buy = Ref(High,1) > Ref(High,2) AND Ref(Low,1) > Ref(Low,2);
Sell = Ref(High,1) < Ref(High,2) AND Ref(Low,1) < Ref(Low,2);
_SECTION_END();

hello algogeek, iam new to amibroker was trying to load inside bar afl shown, through formula editor , chart loads but does not show any arrows or marks .if you could look into it or if their is something i may be doing please let me know. thankyou