StockFetcher Forums · Filter Exchange · A LITTLE PIECE OF CODE ON VOLATILITY<< 1 2 >>Post Follow-up
Kevin_in_GA
4,599 posts
msg #118585
Ignore Kevin_in_GA
3/11/2014 9:25:41 AM

Just playing around with this over the weekend. Thought folks here might find it interesting:

Fetcher[
symlist(spy,iwm)
set{HVstd, cstddev(historical volatility(20),20)}
set{HVma, cma(historical volatility(20),20)}
set{HVdiff, historical volatility(20) - HVma}
set{HVzscore, HVdiff / HVstd}
set{triggerline, cma(HVZscore, 3)}

add column triggerline

draw triggerline line at -2
draw triggerline line at 2

chart-time is 1 year
]



I used a 3-day average to smooth the data, but it is not really required. Look at the cross above -2 or cross below 2 as trigger points.

davesaint86
725 posts
msg #118589
Ignore davesaint86
3/11/2014 12:07:38 PM

So you buy when it crosses below the 2.00 line and sell when it crosses above the -2.00 line?

Kevin_in_GA
4,599 posts
msg #118592
Ignore Kevin_in_GA
3/11/2014 1:56:01 PM

Pretty much - this is really just putting a standard Bollinger band set on the historical volatility. Most of the time, volatility goes down as a stock or index moves up, and volatility goes up quickly if a stock is tanking. This is very much like the VIX index for the SPX. As the HV reaches the upper bollinger, it implies a likely reduction in volatility (prices going back up).

Same process in reverse as well - there is a point where the volatility is so compressed relative to its normal range that an expansion is likely (where prices usually go down).

This specific aproach seems to work best on indices - individual stocks or leveraged ETFs where gaps up/down occur tend to distort the curve. Not saying it won't work on them, but I noticed that odd curve shapes occurred, especially during earnings results.

miketranz
956 posts
msg #118595
Ignore miketranz
3/11/2014 9:23:54 PM

Kevin,while on the subject of volatility,is there a way to filter out low volatility stocks which haven't broken out,using REAC LBTG SVFC as examples? Thanks,Miketranz....

Kevin_in_GA
4,599 posts
msg #118598
Ignore Kevin_in_GA
3/12/2014 10:58:31 AM

Kevin,while on the subject of volatility,is there a way to filter out low volatility stocks which haven't broken out,using REAC LBTG SVFC as examples? Thanks,Miketranz....

++++++

This filter only looks at SPY and IWM - are you asking how to filter FOR these type of stocks, or filter them OUT? These are penny or sub-penny stocks. I would be more concerned about losses from the bid/ask spread than I would volatility (obviously I stay away from the pennies and usually trade only stocks above $10).

miketranz
956 posts
msg #118605
Ignore miketranz
3/12/2014 8:02:48 PM

How to filter for these stocks.$1-5 range,long tight consolidation patterns.

Kevin_in_GA
4,599 posts
msg #118607
Ignore Kevin_in_GA
3/13/2014 9:24:46 AM

That would likely need its own thread - others have asked this and so far there has been no simple code to provide this.

I looked at this as a way to identify potential turning points in the broader markets. Recent market activity has been like a sawtooth, up for a while, pull back, then up again to a new high. Wash, rinse, repeat. What I find interesting about this is that the volatility Z-score trackes fairly nicely with these movements.

Just wanted to share this with the broader group - many people here won't share when asked, and few share without being asked first. Happy to be in the latter group.

mktmole
325 posts
msg #118655
Ignore mktmole
3/18/2014 8:01:10 PM

@ Kevin.
I will "spill the beans", and and say nicely, thank Kevin for your all your posts !

rgds
mm

alf44
2,025 posts
msg #118656
Ignore alf44
modified
3/18/2014 8:43:28 PM

.

" ... and few share without being asked first..."

-----

And for those "few" that DO share ideas ... you sarcastically question, criticize and ridicule ... based on some "nebulous BS backtest" !!!

FUNNY !!!

.

mktmole
325 posts
msg #118657
Ignore mktmole
3/18/2014 10:36:47 PM

alf: "Your" many contributions are greatly appreciated also !!

rgds,
mm



StockFetcher Forums · Filter Exchange · A LITTLE PIECE OF CODE ON VOLATILITY<< 1 2 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.