How to find range of last 20 bars

A strategy where a range of 1% is identified in banknifty and a sell for PE will be trigged when the price crosses above the highest high of that range, indicating a bullish move and hence PE will fall drastically which can be captured by a short position

SELL 10 shares when Symbol(INDICES_NIFTY BANK, ( Period max(20, High(-2) ) - Period min(20, Low(-2) ) ) / Period min(20, Low(-2) ) lower than 0.01 ) and Symbol(INDICES_NIFTY BANK, Close(0) crosses above Period max(20, High(-2) ) ) at 5min candle interval using Candlestick chart. Enter trade between 09:00 to 15:10 and BUY 10 shares when Nth candle(Close,5min,72) higher than 0.0 or at stop loss % of 30 or target profit % of 60 at 5min candle interval using Candlestick chart.

Please check the below video:

For further queries, please write to [email protected]