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 אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יוכלו להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אבל השימוש החוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

רוצה להשתמש בסקריפ זה בגרף?

כתב ויתור