At your important support level you can buy, if candlestick close is above 50% of its range, with low of this candlestick as SL.
At your important resistance level you can sell, if candlestick close is below 50% of its range, with high of this candlestick as SL.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.