OPEN-SOURCE SCRIPT

Bar Dependent Moving Average

Cập nhật
Imagine using an exercising strategy from a gym coach who retired 10 years ago as there dozens of other trainers who constantly try to adapt and find a better approach. You would be missing out.


It's the same with using fixed periods, you just look back.

How about an exercising strategy from a gym coach who is simultaneously trying to adapt himself?

How could you figure out a strategy that adapts with the market as the market is indirectly finding a better approach to take you out?
Relative Moving Averages simply speaking count the total amount of bars and divide it by the period for which you want to use the moving average. Instead of looking at the last X bars, it divides the total amount of bars / X as the moving average period.
It takes all bars into account, the entire chart history essentially turning it into an adaptive moving average, in the example mentioned above into an adaptive exercising strategy.


The Bar Dependent Moving Average Periods are 2,3,5,8 etc., i.e. the entire fibonacci sequence up to 4181.
The white line is the relative fibonacci moving average, which is calculated by adding all Fibonacci Bar Dependent Moving Averages with one another / by the total amount of fibonacci numbers used i.e. 18.
The bar-dependent fibonacci moving average is upon further investigation (on shorter timeframes <30m) a useful support/resistance indicator since the price tends to wick/consolidate or fully break through the fibonoacci bar dependent moving average.



If there are more than 5000 bars of Candlestick data enable the lock in the settings menu to limit the maximum last X bars back to 5000 to make it possible for Tradingview to run the script since Tradingview does not allow it to look more than 5000 bars back.
Phát hành các Ghi chú
Overlay is true, minor coloring update.
Phát hành các Ghi chú
Lock of 5000 bypassed by starting counter from highest timeframe and then going lower once 5000 is crossed.
Since this moving average is the same on every timeframe it doesn't matter which timeframe you choose.
Phát hành các Ghi chú
Fibonacci BDMA's added, relative timeframe function taken out for customization.
Phát hành các Ghi chú
Few errors fixed. Relative Timeframe Integration isn't fully functional, the Flow-Chart is ready to make it work.
As of now a temporary fix has been offered, which is close to being definitively accurate.
Moving Averages

Mã nguồn mở

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

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

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