IkkeOmar

Logarithmic Volatility Direction Index [IkkeOmar]

The LVDI is a Mean-Reversion Indicator. it doesn't detect trends and does not give a signal per se.
What it does is tell you if we have a flashcrash based on the price action and volume that is available. It is not always easy to see with the naked eye, so this indicator can help you DCA into an asset in a smarter way, if you couple it with other trend systems.
Think of this indicator like a form of a volatility index.
Inputs:
len and lenWMA are integers representing different lengths for calculations, and src is the data source
Keep in mind that "Length" is the lookback for the WMA, and the Length smooting is the lookback for the SMA of the "volume_weighted".
WMA Calculation
wma_basic = math.log10(ta.wma(src, len))
This calculates the logarithm (base 10) of the Weighted Moving Average (WMA) of the source data over len periods. WMA is a type of moving average giving more importance to recent data. The reason I use log10, is to make it transformative over a longer timeframe. This makes it easier to see the growth direction. I like to use this for crypto, since there is asymetric upside.

Volume Filter:
average_volume = ta.sma(volume, lenWMA)
volume_weighted = math.log10(wma_basic * (volume / math.log10(average_volume)))
Here, the script first calculates the Simple Moving Average (SMA) of the trading volume over lenWMA periods. Then, it computes a volume-weighted value of the WMA, adjusted by the logarithmic ratio of current volume to average volume.
Distance and Score Calculation:
distance = math.log10(src) - math.log10(volume_weighted)
score = math.sign(distance) * math.pow(math.abs(distance), 2)

The script calculates the logarithmic difference between the source data and the volume-weighted WMA. The score is determined by the sign of this distance multiplied by its square. This potentially amplifies the impact of larger distances.

Plotting:
plot(volume_weighted, title="Volume Weighted WMA", color=color.blue, linewidth = 2)
plot(ta.sma(volume_weighted, lenWMA), title="Volume Weighted WMA", color=color.rgb(189, 160, 0))

Mathematical concepts
Weighted Moving Average (WMA):
WMA is a moving average that assigns more weight to recent data points. The idea is that recent prices are more relevant to the current trend than older prices.

Logarithms:
The use of log10 (logarithm base 10) is interesting. Logarithms help in normalizing data and can make certain patterns more visible, especially when dealing with exponential growth or decay.

Volume Weighting:
Multiplying the WMA by the ratio of current volume to average volume (both logarithmic) integrates volume into the analysis. High trading volume can signify stronger market interest and can thus validate price movements.

Distance and Score:
The distance measures how far the current price is from the volume-weighted WMA on a logarithmic scale. The score squares this distance, potentially highlighting large divergences.


Case example
In the case above (which is a low timeframe that shouldn't be your main system) we see the blue line going up before going below the moving average line (orange). This indicates a local bottom zone. Does that mean that we wont go lower? No! What you can do is calculate a zone range.
We have an average line, you can get that from the POC with the VRVP.
Then you take the low and high of that zone and take the average:
(3.17% + 2.33%) / 2 = 2.75%
This means that we expect that the price can fall an additional 2.75%! Low and behold. When you check the same chart as above:
Hope it makes sense!
Stay safe everyone!
Don't hesitate to ask any questions if you have any!

Join my community where i share signals and my secret algos:

Telegram:
t.me/ikkeomarfree

I can also help you get $50.000 funded!

Just dm my Telegram @IkkeOmar
开源脚本

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

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?