NeoDaNomad

Pivot

NeoDaNomad Aggiornato   
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
Note di rilascio:
v2
Note di rilascio:
v3

Added:
init()

get()

Removed:
pivot()

getPivot()
Note di rilascio:
v4
Libreria Pine

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzare questa libreria in privato o all'interno di altre pubblicazioni open-source, ma il riutilizzo del codice è subordinato al rispetto del Regolamento.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questa libreria?

Copia il testo ed incollalo nel tuo script.