I am looking for a simple swing indicator that returns a value that can be called in the strategy builder for the following swing conditions.
HH: higher High (2)
LH: lower high (1)
LL: lower low (-1)
HL: higher low (-2)
Below is a visual of what I am talking about in the above table with values at each swing point.
I do not need the actual value to print on the chart itself.
The only purpose is to pull that value when creating a strategy.
At any given time, whichever of the 4 above conditions exist as the last printed swing condition, I would like a value assigned until the next swing condition prints on the chart. So for example, if we printed a new Higher High condition on the chart, a value of 2 would be the result for all future bars, until the condition was changed upon the next swing. I need to call a value like this for a strategy I have in mind. I hope this makes sense, and that you can point me in the right direction. Thanks in advance if anyone can help out.

Comment