I am trying to make and indicator to use in my quantstrat backtest but can't seem to figure out how to write it. Basically I want to compare the High and Low from 2 days ago to the H&L from 3 days ago. If day 2's H&L is lower than day 3 I'll make that as a buy signal if not I'll make it a short signal. After that I want to make another indicator to do the same but bring it forward one period so is yesterdays H&L lower than the H&L from 2 days ago and so on.
Originally I was using the donichan channel but realized this wont work as it will hold the same values until one of them makes a new high or low.
I know this is such a simple problem and I'm over thinking it.