Effectively, I want to create a line chart that only plots based on my rules.
Rules:
If the next candle breaks the previous candles high, it's considered part of the UP move.
The candle that doesn't break the previous candles high is considered to be a pullback.
Or
If the next candle breaks the previous candles low, it's considered part of the Down move.
The candle that doesn't break the previous candles low is considered to be a pullback.
Hopefully these images make it a bit clearer.
https://www.tradingview.com/x/jnCRPIXn/
https://www.tradingview.com/x/6gwcqAJm/
Is this possible in PineScript? How difficult do you consider this to code?