Bitcoin Forum
June 28, 2025, 03:09:27 AM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: A trend-adjusted volatility measure for Bitcoin - does that make sense?  (Read 83 times)
d5000 (OP)
Legendary
*
Offline Offline

Activity: 4326
Merit: 8999


Decentralization Maximalist


View Profile
June 19, 2025, 05:50:28 AM
Merited by EarnOnVictor (1), Hatchy (1)
 #1

Inspired by this discussion I wondered if we could improve the volatility indicator for Bitcoin, such as the value displayed at Bitbo.io.

The idea is to remove the long term trend from the equation. Why? Because if the long term trend is bullish (like currently) then volatility will always be a bit higher than what you might expect, just because the trend also impacts in the volatility.

What I'm searching for (in the current long term bullish trend) is a formula that gives a volatility of zero if the Bitcoin price moves up exactly as expected by the long term trend. and otherwise gives the "volatility versus the trend".

A good approximation of the current longterm trend would be a longer SMA, e.g. the SMA-1000 (a timeframe of almost three years) or for more "fresh" values the SMA-365 or the SMA-200.



The Bitbo Volatility is calculated in the following way (N being the number of days):

Quote from: Bitbo FAQ
Bitcoin's daily volatility = Bitcoin's standard deviation = √(∑(Bitcoin's opening price – Price at N)^2 /N).

The idea for the trend-adjusted volatility:  √(∑(Bitcoin's opening price – Price at N – (Price at N * SMA daily change)) ^2 /N)

This means: from each daily price change, we subtract the average SMA daily change.

Expected effect:

- If the SMA daily change is positive and the volatility is to the upside, then the trend-adjusted volatility should be lower than the raw volatility.
- If instead the SMA daily change is positive and the volatility mainly is to the downside, then the trend-adjusted volatility should be higher than the raw value.



On paper, the idea sounded good. I modified a Python script based on another one I already had to calculate the volatility. The "raw" (not adjusted) volatility is close to the value at Bitbo, so the main calculation seems correct.

The expected effect was correct. But it seems the "adjustment" makes much less of a difference than I thought.

For example, for the 30-day volatility on May 18 I get the following values with the SMA-365:

- SMA365 daily change: 0.13097 %
- Volatility without trend adjustment: 1.6465 %
- Volatility with trend adjustment: 1.5929 %

For the current value (June 18) I get even less difference:

- SMA365 daily change: 0.13142 %
- Volatility without trend adjustment: 1.4192 %
- Volatility with trend adjustment: 1.4239 %

That looks strange because the adjusted value is even a bit higher than the raw value. However, that can be probably explained: in the selected period, the trend was slightly bearish, i.e. the volatility was mostly to the downside.

Still I'm wondering if my approach is correct.

Thus I'd like to ask: Am I missing something? Is the formula wrong? Or is the long term trend already so smooth that it almost doesn't matter? (Don't really expect much reactions but perhaps there are some math nerds wanting to join me here Wink ).

Hatchy
Hero Member
*****
Offline Offline

Activity: 826
Merit: 884


The Alliance Of Bitcointalk Translators - ENG>PID


View Profile WWW
June 19, 2025, 07:30:14 AM
Merited by d5000 (1)
 #2

- If the SMA daily change is positive and the volatility is to the upside, then the trend-adjusted volatility should be lower than the raw volatility.
- If instead the SMA daily change is positive and the volatility mainly is to the downside, then the trend-adjusted volatility should be higher than the raw value.

Well, My 1cent though, a long term SMA is pretty much a glacier. Its daily change is minuscule. Bitcoin however, moves in multipercentage point swings. Subtracting that tiny move  from wild daily jumps... it's like trying to adjust a rocket's trajectory with a pebble. Fact here is that the day to day variability is just so much larger than the gentle trend.

 If you're subtracting a near cconstant from a widely dispersed series, you're mostly just shifting the center. The spread of what standard deviation measures some how would just remain largely unaffected.

Even if you're subtracting something proportional to P_i, if that proportionality is still tiny, the effect gets drowned out by Bitcoin sheer daily magnitude. If the trend expects a small rise, but the price dips significantly, the deviation from that expected trend is bigger than from a simple average. 

R


▀▀▀▀▀▀▀██████▄▄
████████████████
▀▀▀▀█████▀▀▀█████
████████▌███▐████
▄▄▄▄█████▄▄▄█████
████████████████
▄▄▄▄▄▄▄██████▀▀
LLBIT|
4,000+ GAMES
███████████████████
██████████▀▄▀▀▀████
████████▀▄▀██░░░███
██████▀▄███▄▀█▄▄▄██
███▀▀▀▀▀▀█▀▀▀▀▀▀███
██░░░░░░░░█░░░░░░██
██▄░░░░░░░█░░░░░▄██
███▄░░░░▄█▄▄▄▄▄████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█████████
▀████████
░░▀██████
░░░░▀████
░░░░░░███
▄░░░░░███
▀█▄▄▄████
░░▀▀█████
▀▀▀▀▀▀▀▀▀
█████████
░░░▀▀████
██▄▄▀░███
█░░█▄░░██
░████▀▀██
█░░█▀░░██
██▀▀▄░███
░░░▄▄████
▀▀▀▀▀▀▀▀▀
||.
|
▄▄████▄▄
▀█▀
▄▀▀▄▀█▀
▄░░▄█░██░█▄░░▄
█░▄█░▀█▄▄█▀░█▄░█
▀▄░███▄▄▄▄███░▄▀
▀▀█░░░▄▄▄▄░░░█▀▀
░░██████░░█
█░░░░▀▀░░░░█
▀▄▀▄▀▄▀▄▀▄
▄░█████▀▀█████░▄
▄███████░██░███████▄
▀▀██████▄▄██████▀▀
▀▀████████▀▀
.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
░▀▄░▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄░▄▀
███▀▄▀█████████████████▀▄▀
█████▀▄░▄▄▄▄▄███░▄▄▄▄▄▄▀
███████▀▄▀██████░█▄▄▄▄▄▄▄▄
█████████▀▄▄░███▄▄▄▄▄▄░▄▀
███████████░███████▀▄▀
███████████░██▀▄▄▄▄▀
███████████░▀▄▀
████████████▄▀
███████████
▄▄███████▄▄
▄████▀▀▀▀▀▀▀████▄
▄███▀▄▄███████▄▄▀███▄
▄██▀▄█▀▀▀█████▀▀▀█▄▀██▄
▄██▀▄███░░░▀████░███▄▀██▄
███░████░░░░░▀██░████░███
███░████░█▄░░░░▀░████░███
███░████░███▄░░░░████░███
▀██▄▀███░█████▄░░███▀▄██▀
▀██▄▀█▄▄▄██████▄██▀▄██▀
▀███▄▀▀███████▀▀▄███▀
▀████▄▄▄▄▄▄▄████▀
▀▀███████▀▀
OFFICIAL PARTNERSHIP
SOUTHAMPTON FC
FAZE CLAN
SSC NAPOLI
d5000 (OP)
Legendary
*
Offline Offline

Activity: 4326
Merit: 8999


Decentralization Maximalist


View Profile
June 23, 2025, 11:03:26 PM
 #3

If you're subtracting a near constant from a widely dispersed series, you're mostly just shifting the center.
I have made some more experiments and yes it seems you're correct. Even using a SMA 200, which I'd consider the shortest longer-term measure, would never change the volatility value by more than 0.2 percentage points in recent years. Even if we use the SMA 60 the effect isn't much stronger. In extremely strong bull markets (let's say April 2013) I got a difference of 0.2 to 0.3 only, at a time when 30-day volatility was above 10 ...

I'm wondering how a more useful volatility measure could look then. I have for example thought about simply ignoring upside volatility, i.e. only considering negative price changes, and compare that with the typical downside volatility of an "average" currency like the Brazilian Real (i.e. not a super-stable currencly like USD, EUR or CNY, but also not the VEF or the ARS).

If we calculate downside volatility "naively" simply filtering out all upside movements, it is of course lower than the "full volatility". For example, for June 17, 2025, I get a 30-day volatility of 1.41 %, and a 30 day downside volatility of 0.98 %. On May 17, the downside volatility was even on 0.43 %. While during crashes both values are closer, for example on August 15, 2024, volatility was 3.02 % and downside volatility 2.46 %.

Another idea would be to flatten out daily changes by using something like the volatility of the SMA-7 or even the SMA-30. That may actually be a better idea. I'll have to update my script for that though.

EarnOnVictor
Hero Member
*****
Offline Offline

Activity: 1092
Merit: 741



View Profile
June 24, 2025, 04:23:38 AM
 #4

I took my time to ponder what you suggested, it's genius, at least you wanted to make it perform better, but in the end, it is what it is, the indicator type, price adjustments and timeframes will always be the huge factors to trim the trend-volatility response. That's how it was calculated and coded to function. Some variation should indeed impact the trend-adjusted volatility, but is it not the reason why the different MA types, timeframes and adjusted periods are added?

Regardless, going by your way, the SMA-365 (30-day) is long-term enough, so the impact on the indicator response will be reduced compared to the short-term variables. So the daily change will be limited compared to the one adjusted by value to move faster. This explains why the first does not have much difference.

As for that of June, it validates your view more with a bearish deviation. You may not be satisfied, but that is how it will be. The SMA period and the time duration are the major factors here.

 

.
 betpanda.io 
 
ANONYMOUS & INSTANT
.......ONLINE CASINO.......
▄███████████████████████▄
█████████████████████████
█████████████████████████
████████▀▀▀▀▀▀███████████
████▀▀▀█░▀▀░░░░░░▄███████
████░▄▄█▄▄▀█▄░░░█▄░▄█████
████▀██▀░▄█▀░░░█▀░░██████
██████░░▄▀░░░░▐░░░▐█▄████
██████▄▄█░▀▀░░░█▄▄▄██████
█████████████████████████
█████████████████████████
█████████████████████████
▀███████████████████████▀
▄███████████████████████▄
█████████████████████████
██████████▀░░░▀██████████
█████████░░░░░░░█████████
███████░░░░░░░░░███████
████████░░░░░░░░░████████
█████████▄░░░░░▄█████████
███████▀▀▀█▄▄▄█▀▀▀███████
██████░░░░▄░▄░▄░░░░██████
██████░░░░█▀█▀█░░░░██████
██████░░░░░░░░░░░░░██████
█████████████████████████
▀███████████████████████▀
▄███████████████████████▄
█████████████████████████
██████████▀▀▀▀▀▀█████████
███████▀▀░░░░░░░░░███████
██████░░░░░░░░░░░░▀█████
██████░░░░░░░░░░░░░░▀████
██████▄░░░░░░▄▄░░░░░░████
████▀▀▀▀▀░░░█░░█░░░░░████
████░▀░▀░░░░░▀▀░░░░░█████
████░▀░▀▄░░░░░░▄▄▄▄██████
█████░▀░█████████████████
█████████████████████████
▀███████████████████████▀
.
SLOT GAMES
....SPORTS....
LIVE CASINO
▄░░▄█▄░░▄
▀█▀░▄▀▄░▀█▀
▄▄▄▄▄▄▄▄▄▄▄   
█████████████
█░░░░░░░░░░░█
█████████████

▄▀▄██▀▄▄▄▄▄███▄▀▄
▄▀▄█████▄██▄▀▄
▄▀▄▐▐▌▐▐▌▄▀▄
▄▀▄█▀██▀█▄▀▄
▄▀▄█████▀▄████▄▀▄
▀▄▀▄▀█████▀▄▀▄▀
▀▀▀▄█▀█▄▀▄▀▀

Regional Sponsor of the
Argentina National Team
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!