Hi Satya
From Teach A man to fish And.............By Saint
http://www.traderji.com/equities/21903-going-60min-flow-52.html
So what then is a Pivot?Okay,we are back to the "Hand" example.Whisk out your right hand again,once again with your right palm facing you.We have our little finger.The ring finger makes a higher high and low as compared to the little finger.The middle finger is higher high and low as compared to the ring finger.We therefore have a RALLY.The index finger makes lower highs and lows as compared to the middle finger.The thumb makes lower highs and lows as compared to the index finger.We therefore have a DECLINE.The middle finger with two lower highs on both sides(ring and index)now forms a PIVOT.
I have not written the code
But the code uses
The basic definition of Pivot High is a bar high that is both higher than the two bars immediately preceding it and higher than the two bars immediately following it.
The lows of the bars are NOT considered in determining the Pivot progression.
If two bars in the progression have equal highs followed by two consecutive bars with lower highs, then a total of six bars rather than the usual five bars will make up the progression.
The first High becomes the counting Pivot. Reverse for Low Pivot.
Regards
ken