Tutorial 182 | Highest pivot within user input number of bars

1 year ago
1

Tutorial 182 demonstrates a EasyLanguage Show-me study that calculates the pivot with the highest value WITHIN a user input number of bars of the current bar (user input: LookbackBars). (N.B. This is different from finding the highest pivot value on the chart.) Each time a pivot is found it is plotted. The bar number and the price level are stored in a dictionary.

At the end of each bar the dictionary is traversed and index/values pairs where the pivot occurred more than user input LookBackBars ago are deleted. The dictionary values are then copied into a vector (named Values) which is sorted to find the highest value using the Markplex _VectorQuickSort function. This value is plotted.

More information about the _VectorQuickSort function, which uses a recursive method can be found at: https://markplex.com/free-tutorials/t...

The tutorial program and the _VectorQuickSort function are available for download at no cost to Gold Pass members.

This tutorial does not work with MultiCharts.

Loading comments...