Average Lines

Average Lines
This script beholds several new exiting Pine stuff:
- linefill, fill of
- last_bar_index, gives the bar_index of the last bar, already at the beginning of the script! (like 'timenow', but now with bar_index)

The script is about pivot points , if there is one, it draws a line from the last to every previous one, then it extends this line to the future. On every next bar, all these lines and added and averaged, this gives an average line of all extended lines which are projected in the 'future'.
In that way, we create a new kind of moving average

Do mind, since the visible lines maximum of 500 it can easily happen that an average is made of way more lines than 500, but that you cannot see all of them

版本注释: Deeper explanation:

- Leftbars, Rightbars -> for Pivot Point Calculation ({dot}pivothigh)
- Fill lines -> Yes/No
- Choice -> Show only ph (pivot high lines), pl (pivot low lines), both or none
- Max pivot points for calculation -> Set the max previous PP 's every PP gets connected to
- Max bars between concerning bar and last bar -> This sets the 'start', for example, you want to include the latest 1000 bars -> set 1000
- colour settings

版本注释: update
版本注释: update picture

#trusted pine programmers for hire

- We cannot control our emotions,
but we can control our keyboard -

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。