Actionable Daily Historical Volatility for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Warehouse
This indicator uses historical volatility of the last 10 and 100 days. Not much information about it but I'm seeing some good cross up and cross down signals.



thinkScript Code

Code:
# Actionable Daily Historical Volatility
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/141g43Qm/

declare lower;

# Historical Volatility 10 day
def HV = stdev(log(close / close[1]), 10) * sqrt(365) * 100;
# Historical Volatility 100 day
def HV1 = stdev(log(close / close[1]), 100) * sqrt(365) * 100;

assignPriceColor(if HV>HV1 and HV[1]<HV1[1] then Color.Green else if HV<HV1 and HV[1]> HV1[1] then Color.Red else Color.White);

plot tenHV = HV;
plot HundredHV = HV1;

tenHV.SetDefaultColor(GetColor(1));
HundredHV.SetDefaultColor(GetColor(0));
 
D

diazlaz

Member
VIP
Warehouse
thanks Ben for sharing. Interesting concept; wouldn't it require a daily chart, since it's calc the HV and SQRT of the day, curious to see if the indicator was designed for daily time frame, rather than intraday timeframe?

I will stop check it to see if there is any variations.
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@diazlaz Certainly, I think you should look at the daily chart first for this particular indicator. On $SPY it definitely spotted some nice bullish reversal signals.



It doesn't hurt to test on lower timeframes either :)
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
This was shared with our Warehouse members last week. It's now available to everyone.
 
R

Rsva0610

New member
Dear Ben, Can you please check for ROKU for Daily Timeframe the condition is failing, it is showing green candle when there is huge sell off.
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Rsva0610 In that case it’s a false signal. I can’t do anything about that.
 
H

horserider

Well-known member
VIP
Warehouse
Before anyone depends on this indicator make sure you read about HV. My understanding is it shows historical volatility of a stock without regard to direction. So how does this indicator function to choose a direction ? Makes little sense to me. Maybe someone can explain.
 
markos

markos

Well-known member
VIP
Warehouse
@horserider you are correct that historical volatility on its own does not function to choose direction.
In this case, the code seems to compare the 10 day to the 100 day, so in this case looking at whether something is above or below, higher or lower, may give some sort of signal. Utility is, of course, up to the person using the indicator.
 

Top