This pine script is provide recent support and resistance.
Script will use ema8, ema21, sma50 and sma200 to generate the support and resistance line.
Inspired from Patrick Walker style of trading. This is my personal logic i build studying the charts.
There is 3 types of resistance generated by this script.
1) top resistance 1
when ema8 > ema21 and low > ema8 and gap between ema21 and sma50 is less than 10% and in last 3 days previous 4th days highs is not crossed by close.
2) top resistance 2
when close/open below ema21 and ema8 > ema21 and high >= ema8 and ema21 > sma50 and gap between ema21 and sma50 is less than 10%
3) bottom resistance
when ema8 < ema21 and close/open cross above ema8 but high < ema21