NeoDaNomad

Pivot

NeoDaNomad Mis à jour   
This library was designed to create three different datasets using Bill Williams fractals. The goal is to spot trends in reversal data and ultimately use these datasets to help predict future price reversals.

First, the pivot() function is used to initialize and populate three separate arrays (high pivot, low pivot, all pivots). Since each high/low price depends on the bar_index, the bar_index, pivot direction(high/low), and high/low values are compressed into a string to maintain the data's integrity ("<bar_index>_<direction>_<price>"). Once each string array is populated and organized by bar_index, all three are returned inside a tuple. The return value must be deconstructed H,L,A=pivot() for each array's values to be accessed using getPivot(). This boilerplate allows for data to be accessed more efficiently in a recursive environment. getPivot() was designed to be used inside of a for or while block to populate matrices for further analyses. Again, getPivot() return values must be exposed through deconstruction. x,d,y=getPivot(). See code for more details.

pivot(int XLR) initializes and populates arrays

Parameters
  • XLR - number of bars to the left and right that must be lower for a high to be considered a pivotHigh, or vice versa. This number will drastically change the size and scope of the returned datasets. smaller values will produce much larger datasets, which might model short term price activity well. In contrast, larger values will produce smaller datasets which might model longer term price activity well.
Returns - tuple[string]


getPivot(string arrayID, int index) accesses array data

Parameters
  • arrayID - the variable name for one of the three arrays returned by pivot().
  • index - the index of the provided array, with 0 being the most recent pivot point. can be set to "i" in a loop to access values recursively
Returns - tuple
Notes de version:
v2
Notes de version:
v3

Added:
init()

get()

Removed:
pivot()

getPivot()
Notes de version:
v4
Bibliothèque Pine

Dans le véritable esprit de TradingView, l'auteur a publié ce code Pine en tant que bibliothèque open-source afin que d'autres programmeurs Pine de notre communauté puissent le réutiliser. Bravo à l'auteur ! Vous pouvez utiliser cette bibliothèque à titre privé ou dans d'autres publications open-source, mais la réutilisation de ce code dans une publication est régie par notre Règlement.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser cette bibliothèque?

Copiez le texte dans le presse-papiers et collez-le dans votre script.