1) At first, we test if the ema 9 is up or down if it is Up the background is painted yellow and you can find the reference candles for the setups if it is down the background is Gray and you can find the reference candles for the setups
2) Then we compare the close, highs and lows if the candle match some of the setup rules, and if match we plot a sign in the reference candle with the name of respective setup, now you can decide in the next candle if it is eligible for an entry SHORT/LONG position.
Please, few free to comment and tell me any inconsistency and possible upgrades...
Later as soon I’m get used withe pine script I will improve this script with more and more features