Tuesday, July 22, 2014

Useful Trading Tools: IV% Rank, and % Change thinkscripts for thinkorswim

There is a tool that I have come to use, and cherish every day in my path to becoming a better trader. I took this tool from the very first segment of "Game Changers" video's posted from TastyTrade, which is simply a visual representation of the IV% rank, and %Pricechange over a period of time (the default is 10 days, but you may change that at your discretion) shown in the upper left corner of your ThinkorSwim chart.


This information at a glance proves to be very useful in monitoring for trade set-ups, and strategies. I personally use it to also gauge the general market environment.

If you're interested in adding this to your quiver here is the thinkscript taken from the TastyTrade video as mentioned above: 

*Please note that I do not take any credit for this thinkscript, but only wish to share something that I find very helpful.*

Price Percentile Script:

1) Go to 'Charts' tab
2) Click on the "eye-dropper" icon (officially called "edit studies icon"...same line where you type in the ticker same symbol, first icon moving left to right)
3) Click on "New"... Lower left hand corner
4) Delete everything in the box. (plot Data = close;)
5) Paste the entire code listed below
6) Name the study PricePercent
7) Click 'OK'
8) Click 'Apply'
9) Click 'Ok'

input length = 10;
input price = FundamentalType.CLOSE;
input pricePercentUP = 5.0;
input pricePercentDOWN = -5.0;

def priceday= Fundamental(price,period = aggregationPeriod.DAY);
def high=Highest(priceday[1],length);
def low=Lowest(priceday[1],length);
def PcntChHigh= 100 * (priceday / high -1);
def PcntChLow= 100 * (priceday /low -1);
def PercentChg = if(AbsValue(PcntChHigh)>=AbsValue(PcntChLow),
Round(PcntChHigh, 2),
Round(PcntChlow, 2));

AddLabel(1, Concat ("% Price Chng:", PercentChg ),if percentChg >= pricePercentUP then color.dark_green else if percentChg <= pricePercentDOWN then color.red else color.gray); 
------------------------------------------------------------------------------------------------------
IV Percentile Script: 

1) Go to 'Charts' tab
2) Click on the "eye-dropper" icon (officially called "edit studies icon"...same line where you type in the ticker same symbol, first icon moving left to right)
3) Click on "New"... Lower left hand corner
4) Delete everything in the box. (plot Data = close;)
5) Paste the entire code listed below
6) Name the Study
7) Click 'OK'
8) Click 'Apply'
9) Click 'OK'
 
declare upper;
input period = AggregationPeriod.DAY ;
#hint period: time period to use for aggregating implied volatility.
input length =252 ;
#hint length: #bars to use in implied volatility calculation.
def ivGapHi = if isnan(imp_volatility(period=period)) then 99999999999 else imp_volatility(period=period);
def ivGapLo = if isnan(imp_volatility(period=period)) then -99999999999 else imp_volatility(period=period);
def periodHigh = highest( ivGapLo,length=length);
def periodLow = lowest( ivGapHi, length=length);
def ivRange = periodHigh - periodLow ;
def ivp = round( 100*(imp_volatility(period=period) - periodLow)/ivRange, 0);
 
AddLabel(1, Concat("IV% ", ivp), if ivp > 80
     then Color.Green
     else if ivp < 80 and ivp > 50
     then Color.Yellow
     else color.Red);

Hints:     
a) Use 252 as input length for 1-year or 52-week IV percentile
b) You can change 252 to 189 for 9-month IV percentile
c) You can change 252 to 126 for 6-month IV percentile


No comments:

Post a Comment