fikira

Average Lines

fikira Wizard Cập nhật   
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!
Phát hành các Ghi chú:
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!
Phát hành các Ghi chú:
update
Phát hành các Ghi chú:
update picture
Phát hành các Ghi chú:
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'

Cheers!

LuxAlgo Dev: www.luxalgo.com
PineCoder: www.pinecoders.com

- We cannot control our emotions,
but we can control our keyboard -
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?