Average Lines This script beholds several new exiting Pine stuff: - linefill, fill of line.new - 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
Cheers!
릴리즈 노트
Deeper explanation:
Settings: - Leftbars, Rightbars -> for Pivot Point Calculation (https://www.tradingview.com/pine-script-reference/v5/#fun_ta{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
Cheers!
릴리즈 노트
update
릴리즈 노트
update picture
릴리즈 노트
Improvement of performance, especially on second timeframes However, lots of calculations are going on When there are issues, 1 of more of the following can be done: - only use 'ph' or 'pl' as 'choice' instead of 'both' - lower the 'max pivot points for calculations' (example to 100 or 50) - lower 'max bars between concerning bar and last bar'
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.