I'd like to try and write an indie that changes the color of my price chart background based on the state of the current trend, as defined by predetermined sequences of high and low pivots.
I was hoping to establish five levels of trend:
("low" and "high" refer to a 5-candle Pivot)
low followed by high followed by higher low = light green
low followed by high followed by higher low followed by higher high= darker green
high followed by low followed by lower high = light red
high followed by low followed by lower high followed by lower low= darker red
any other sequence = gray
Is this something that would be possible in Ninja?
Are there problems of logic?
Would a start point have to be defined?
I've attached an image that might make my rambling clearer...
Many thanks in advance for any help.

Comment