OPEN-SOURCE SCRIPT

Bar Dependent Moving Average

已更新
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.
版本注释
Overlay is true, minor coloring update.
版本注释
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.
版本注释
Fibonacci BDMA's added, relative timeframe function taken out for customization.
版本注释
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

开源脚本

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

想在图表上使用此脚本?

免责声明