|
Cincinnati, OH
Posts: 2 since Mar 2014
Thanks Given: 0
Thanks Received: 0
|
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. NexusFi (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!
|