#Quadruple Witching Dates
#Quadruple witching occurs when four types of derivatives expire on the same day: stock options, stock index options, stock futures and stock index futures.
def h = Double.POSITIVE_INFINITY;
def l = Double.NEGATIVE_INFINITY;
def year = (Round(GetYYYYMMDD() / 10000, 0));#Thie produces the year as1,210
def Month = GetMonth();
def Day = GetDayofMonth(GetYYYYMMDD());
def ExpMonth = (Month == 3 or Month == 6 or Month == 9 or Month == 12);
def NextFri = Next3rdFriday(series = 1);
plot Hup1= if ExpMonth and NextFri[1]==1 Then h else double.NaN;
plot Hdn1= if ExpMonth and NextFri[1]==1 Then high - ((high-low)*1.5) else double.NaN;
AddChart(high = Hup1, low = Hdn1, open = Hup1, close = Hdn1, type = ChartType.CANDLE, growColor = color.BLUE);
plot Hup2= if ExpMonth and NextFri[1]==1 Then high + ((high-low)*1.5) else double.NaN;
plot Hdn2= if ExpMonth and NextFri[1]==1 Then l else double.NaN;
AddChart(high = Hup2, low = Hdn2, open = Hup2, close = Hdn2, type = ChartType.CANDLE, growColor = color.BLUE);
AddVerticalLine(ExpMonth and NextFri[1]==1 , " Quadruple Witching", Color.BLACK);
#Quadruple witching occurs when four types of derivatives expire on the same day: stock options, stock index options, stock futures and stock index futures.
def h = Double.POSITIVE_INFINITY;
def l = Double.NEGATIVE_INFINITY;
def year = (Round(GetYYYYMMDD() / 10000, 0));#Thie produces the year as1,210
def Month = GetMonth();
def Day = GetDayofMonth(GetYYYYMMDD());
def ExpMonth = (Month == 3 or Month == 6 or Month == 9 or Month == 12);
def NextFri = Next3rdFriday(series = 1);
plot Hup1= if ExpMonth and NextFri[1]==1 Then h else double.NaN;
plot Hdn1= if ExpMonth and NextFri[1]==1 Then high - ((high-low)*1.5) else double.NaN;
AddChart(high = Hup1, low = Hdn1, open = Hup1, close = Hdn1, type = ChartType.CANDLE, growColor = color.BLUE);
plot Hup2= if ExpMonth and NextFri[1]==1 Then high + ((high-low)*1.5) else double.NaN;
plot Hdn2= if ExpMonth and NextFri[1]==1 Then l else double.NaN;
AddChart(high = Hup2, low = Hdn2, open = Hup2, close = Hdn2, type = ChartType.CANDLE, growColor = color.BLUE);
AddVerticalLine(ExpMonth and NextFri[1]==1 , " Quadruple Witching", Color.BLACK);