This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare lower; | |
declare hide_on_intraday; | |
# Z-normalized of log(IV) | |
def vol = if (GetSymbol() == "/ES") then close("VIX") / 100 | |
else if (GetSymbol() == "/CL") then close("OIV") / 100 | |
else if (GetSymbol() == "/GC") then close("GVX") / 100 | |
else if (GetSymbol() == "/SI") then close("VXSLV") / 100 | |
else if (GetSymbol() == "/NQ") then close("VXN") / 100 | |
else if (GetSymbol() == "/TF") then close("RVX") / 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare lower; | |
declare hide_on_intraday; | |
#IVPercentile | |
def vol = if (GetSymbol() == "/ES") then close("VIX") / 100 | |
else if (GetSymbol() == "/CL") then close("OIV") / 100 | |
else if (GetSymbol() == "/GC") then close("GVX") / 100 | |
else if (GetSymbol() == "/SI") then close("VXSLV") / 100 | |
else if (GetSymbol() == "/NQ") then close("VXN") / 100 | |
else if (GetSymbol() == "/TF") then close("RVX") / 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare lower; | |
declare hide_on_intraday; | |
#IVPercentile | |
def vol = if (GetSymbol() == "/ES") then close("VIX") / 100 | |
else if (GetSymbol() == "/CL") then close("OIV") / 100 | |
else if (GetSymbol() == "/GC") then close("GVX") / 100 | |
else if (GetSymbol() == "/SI") then close("VXSLV") / 100 | |
else if (GetSymbol() == "/NQ") then close("VXN") / 100 | |
else if (GetSymbol() == "/TF") then close("RVX") / 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This displays the day's change in IV Percentile | |
declare lower; | |
declare hide_on_intraday; # do not display when using intra-day plots | |
input days_back = 252; # it is most common to use 1-year (or 252 trading days) | |
def df = if (GetSymbol() == "/ES") then close("VIX") / 100 | |
else if (GetSymbol() == "/CL") then close("OIV") / 100 | |
else if (GetSymbol() == "/GC") then close("GVX") / 100 | |
else if (GetSymbol() == "/SI") then close("VXSLV") / 100 | |
else if (GetSymbol() == "/NQ") then close("VXN") / 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare lower; | |
# Adapted from Mark Laczynski: https://pdvwrt.blogspot.com/2014/03/think-or-swim-tos-iv-percentile.html | |
# look at 1 year of history | |
input length = 252; | |
declare hide_on_intraday; # do not display when using intra-day plots | |
#clean up the IV data from TOS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"IAB1": "Arts & Entertainment", | |
"IAB1-1": "Books & Literature", | |
"IAB1-2": "Celebrity Fan/Gossip", | |
"IAB1-3": "Fine Art", | |
"IAB1-4": "Humor", | |
"IAB1-5": "Movies", | |
"IAB1-6": "Music", | |
"IAB1-7": "Television", | |
"IAB2": "Automotive", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Copy and paste this into a new script for you spreadsheets | |
function leftJoin(left, right, left_index, right_index, header, results_sheet) { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
left = right || ss.getRangeByName("range1").getValues(); | |
right = right || ss.getRangeByName("range2").getValues(); | |
left_index=left_index || 0; | |
right_index=right_index ||0; | |
header = header || true; | |
results_sheet = results_sheet || "join_output" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |