Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I want to find the lowest implied volatility level where some large percentage of days is less than. In other words, given a percentage P% for a given underlying, fill in the blank in the following statement: "P% of the time, implied volatility is less than BLANK." My difficulty is writing this functionality in thinkScript, which is why I am posting it here. I have written the logic two different ways in C programs and also written a stub "study" in thinkScript. futures.io (formerly BMT) won't let me post a link to my tarball here, so if interested look me up @tomstevelt and get it from my recent tweet. Or send me a message here.
Based on my observations, the IV level I am looking for is much lower than the percentage of high minus low. It looks to me that IV cruises along at a low to medium low level, with occasional spikes up and back down.
#
# Script: IV_Level ( Percent );
# Author: Tom Stevelt
# Date : March 9, 2014
# Result: Plot implied volatility AND
# answer the question:
# P% of the time, IV is below X.
# Twittr: @tomstevelt
declare lower;
input Percent = 90.0;
plot Data = imp_volatility();
# Need code here! Stub value reasonable for SPX
def Answer = 17.12;
plot Level = Answer / 100.0;
AddLabel ( yes, Concat(Concat ( Percent, "% of the time, IV is below " ), Concat ( Answer, "." )) );
Thanks for looking, please share success!
Can you help answer these questions from other members on NexusFi?
Settings :
window - full number of bars you want to calculate percentage of.
IVCut - lower implied volatility level...
for example by default this study will look how many times in last 200 bars the implied volatility was lower than 12%
Then it takes the calculated number and show it as a percent of 200.
Thanks for your code, very nice example of the fold statement. Unfortunately, you calculated the percentage, with IV Level as an input. I am looking for the opposite: given a percentage, find the IV level that would "cut" the data set. If you look at my sample again, you'll see one input for Percentage. And then a stub to find and display the Answer.
I am starting to believe this can not be accomplished in thinkScript.
I've seen your percentage input...and was thinking about realisation of this....but this task require to create the new, user defined array of IV data to search from. Thinkscript doent have such functionality yet
This piece of code at least helps a little..it may looks like ancient age style but IV is not that big number so you can find it manually by adjusting the IV setting and to look at percentage level until it reach the value you want.
To finetune it a little more we can change IV variable type to float... it will be