I want to kept the value of the last pivot high using the formula
Code: Select all
LSH1 = PivotHighVS(1, High, 1, 1, 21);
This will give me the first occurrence of a high bar price having a lower high on each side for the last 21 bars.
It work great except when the highest price as the same value as the preceding one, IE: a double top. In my view, this is not a pivot because price was not able to go over is last previous price, both high's are equal.
Any idea how I could code to get only a high pivot value for a bar that as a lower high on each side.