NeoDaNomad

Pivot

NeoDaNomad 已更新   
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
版本注释:
v2
版本注释:
v3

Added:
init()

get()

Removed:
pivot()

getPivot()
版本注释:
v4
Pine脚本库

本着真正的TradingView精神,作者将此Pine代码以开源脚本库发布,以便我们社区的其他Pine程序员可以重用它。向作者致敬!您可以私下或在其他开源出版物中使用此库,但在出版物中重用此代码受网站规则约束。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想使用这个脚本库吗?

复制以下行并将其粘贴到您的脚本中。