tag:blogger.com,1999:blog-3851157926546166456.post5800178852686773052..comments2019-10-16T03:21:17.176-07:00Comments on smalldog investor: thinkscript included: sdi_ivp_alert - implied volatility percentile that is compatible with study alerts.AllenEvhttp://www.blogger.com/profile/13019660317173413162noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-3851157926546166456.post-80791051186278479072016-01-09T19:24:29.548-08:002016-01-09T19:24:29.548-08:00It is also known as the Z-statistic, in this case ...It is also known as the Z-statistic, in this case for 1 tail only.<br />Jonathon Walkerhttps://www.blogger.com/profile/03964432297267904131noreply@blogger.comtag:blogger.com,1999:blog-3851157926546166456.post-29656956013860714262016-01-09T19:21:45.936-08:002016-01-09T19:21:45.936-08:00Allen, I like your script. I've been using the...Allen, I like your script. I've been using the standard IV_percentile function in TOS watchlists and scans to bring my attention to the underlyings with the fattest IV out there. However, even though it is labeled IV_Percentile in TOS, the script behind it is really just calculating IV_Rank (i.e. current IV relative to range high and low); much like the script you provide above. <br /><br />From personal experience, and as confirmed from the Dr. Data Data Science show on TastyTrade.com, the IV_Rank does not represent the bulk of the distribution as well as the IV_Percentile does (i.e. current IV relative to the entire IV distribution). In fact, they can be vastly different from each other; enough such that scans based on the IV_Rank can miss many underlyings with fat premium that are also great trade candidates. The technical problem is that the thinkscript fold function is needed to calculate the IV_percentile; and although it is supported by the charts, it is not supported by the watchlists or scans.<br /><br />However, I found a solution! I've coded what I call an IV_Factor that calculates the number of standard deviations (SD) the current IV is above the average IV, It can be used as a relative IV ranking scheme [(IV-AvgIV)/StDevIV)], just like the IV_Percentile. Since IV follows a normal distribution and is mean reverting, this statistic is pretty handy with 97.7% of the data less than 2 SD and 84.1% less than 1 SD. It works quite well ranking wise and ranks the underlyings in roughly the same order as the IV_percentile would within +/- 1-2% IV_percentile due to the inherent data smoothing differences between the way the two calculations are performed. Close enough I say for TastyTraders who want to find the richest IV around.<br /><br />Simply scan for IV_Factor > 0 (i.e. greater than the average) and rank them according to how many standard deviations the IV is above the average IV. The higher the number, the richer the premium relative to the distribution over the last year; with numbers above 2 being exponentially more and more rare. I have included the scan script below and and I'm also submitting it to TastyTrade for consideration on their GameChangers show.<br /><br />-------------------------------------------------------------------<br /><br />#IV_Factor: Calculates the number of standard deviations above the average IV of the current IV value for the evaluated time period. Values greater than 0 represent higher than average IV relative to the number of standard deviations. 95% of all the IV should fall within 2 standard deviations since IV is normally distributed. High IV results in rich premium to sell. This acts as a surrogate for the true IV_percentile since the fold fuction necessary to calculate the IV percentile is not supported in watchlists or scan thinkscript.<br />#Created by Jonathon Bill Walker 01/09/16<br /># copyrights reserved. This is free software. That means you are free to use or modify it for your own usage but not for resale. <br /><br />##################################<br /># INPUTS <br />##################################<br />declare lower;<br />input length = 13;<br />input TimePeriod = 252;<br />def vol = imp_volatility();<br />def data = if !IsNaN(vol) then vol else vol[-1];<br /><br />##################################<br /># IV Factor<br />##################################<br />def AvgIV = average(vol,TimePeriod);<br />def SDIV = StDev(vol,TimePeriod);<br />plot IV_Factor = (vol - AvgIV) /(SDIV) ;<br /><br />-------------------------------------------------------------------Jonathon Walkerhttps://www.blogger.com/profile/03964432297267904131noreply@blogger.comtag:blogger.com,1999:blog-3851157926546166456.post-64938911674082086282016-01-09T19:19:33.178-08:002016-01-09T19:19:33.178-08:00This comment has been removed by the author.Jonathon Walkerhttps://www.blogger.com/profile/03964432297267904131noreply@blogger.comtag:blogger.com,1999:blog-3851157926546166456.post-74947841306193704092016-01-09T19:08:19.665-08:002016-01-09T19:08:19.665-08:00This comment has been removed by the author.Jonathon Walkerhttps://www.blogger.com/profile/03964432297267904131noreply@blogger.comtag:blogger.com,1999:blog-3851157926546166456.post-6116192560859548262015-07-12T22:22:07.733-07:002015-07-12T22:22:07.733-07:00Just another great Script. Much appreciate. And yo...Just another great Script. Much appreciate. And you even provide Atom Feeds. Just subscribed. Thanks EllenAnonymousnoreply@blogger.com