NeoDaNomad

Pivot

NeoDaNomad Aktualisiert   
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
Versionshinweise:
v2
Versionshinweise:
v3

Added:
init()

get()

Removed:
pivot()

getPivot()
Versionshinweise:
v4
Pine Bibliothek

In echter TradingView-Manier hat der Autor diesen Pine-Code als Open-Source-Bibliothek veröffentlicht, so dass andere Pine-Programmierer aus unserer Community ihn weiterverwenden können. Ein Hoch auf den Autor! Sie können diese Bibliothek privat oder in anderen Open-Source-Publikationen verwenden, aber die Wiederverwendung dieses Codes in einer Publikation unterliegt den Hausregeln.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.

Möchten Sie diese Bibliothek nutzen?

Kopieren Sie die folgende Zeile und fügen Sie sie in Ihr Skript ein.