MetaStock -> Tools -> Indicator Builder -> New -> copy & paste complete formulae below. ========================== VIX Option Expiration Days ========================== ---8<------------------------------------ {VIX/VXN/RVX Option Expiration Days v2.0 Signals VIX/VXN/RVX Options expiration day: The Wednesday that is 30 days prior to the 3rd Friday of the following calendar month. Copyright © 2009 Jose Silva. The grant of this license is for personal use only - no resale or repackaging allowed. All code remains the property of Jose Silva. http://www.metastocktools.com } {Input} plot:=Input("plot: [1]Expiration Wed, [3]rd Friday of Month",1,3,1); {3rd calendar Friday of month} 3rdFri:=OptionExp()=1; {Remove extra WedExp signal from 5-week months} d:=DayOfMonth(); m:=Month(); y:=Year(); leap:= Mod(y,4)=0 AND Mod(y,100)>0 OR Mod(y,400)=0; MthLen:= If(m=2 AND leap=0,28, If(m=2 AND leap,29, If(m=4 OR m=6 OR m=9 OR m=11,30,31))); Ok:=(d=13 AND MthLen>28 OR d=14 AND MthLen>29 OR d=15 AND MthLen>30)=0; {Option expiry signals} expWed:=Ok*OptionExp()=3 OR OptionExp()=31; {Plot} If(plot=1,expWed,3rdFri) ---8<------------------------------------ ====================================== Vix Options expiry Close in retrospect ====================================== ---8<------------------------------------- {VIX/VXN/RVX Options Expiration Close v1.0 Plots expiration Close in retrospect/hindsight for past 3 years. Do not trade! Plot on daily or intraday price charts only. Needs "VIX Option Expiration Days" indicator. Copyright © 2009 Jose Silva. The grant of this license is for personal use only - no resale or repackaging allowed. All code remains the property of Jose Silva. http://www.metastocktools.com } {Signals} x:=Fml("VIX Option Expiration Days"); y:=LastValue(Cum(x))-Cum(x)+x+1; {Options expiry !future! Close} x1:=LastValue(C)*(y=1); x2:=LastValue(Highest(C*x*(y=2)))*(y=2); x3:=LastValue(Highest(C*x*(y=3)))*(y=3); x4:=LastValue(Highest(C*x*(y=4)))*(y=4); x5:=LastValue(Highest(C*x*(y=5)))*(y=5); x6:=LastValue(Highest(C*x*(y=6)))*(y=6); x7:=LastValue(Highest(C*x*(y=7)))*(y=7); x8:=LastValue(Highest(C*x*(y=8)))*(y=8); x9:=LastValue(Highest(C*x*(y=9)))*(y=9); x10:=LastValue(Highest(C*x*(y=10)))*(y=10); x01:=x1+x2+x3+x4+x5+x6+x7+x8+x9+x10; x1:=LastValue(Highest(C*x*(y=11)))*(y=11); x2:=LastValue(Highest(C*x*(y=12)))*(y=12); x3:=LastValue(Highest(C*x*(y=13)))*(y=13); x4:=LastValue(Highest(C*x*(y=14)))*(y=14); x5:=LastValue(Highest(C*x*(y=15)))*(y=15); x6:=LastValue(Highest(C*x*(y=16)))*(y=16); x7:=LastValue(Highest(C*x*(y=17)))*(y=17); x8:=LastValue(Highest(C*x*(y=18)))*(y=18); x9:=LastValue(Highest(C*x*(y=19)))*(y=19); x10:=LastValue(Highest(C*x*(y=20)))*(y=20); x02:=x1+x2+x3+x4+x5+x6+x7+x8+x9+x10; x1:=LastValue(Highest(C*x*(y=21)))*(y=21); x2:=LastValue(Highest(C*x*(y=22)))*(y=22); x3:=LastValue(Highest(C*x*(y=23)))*(y=23); x4:=LastValue(Highest(C*x*(y=24)))*(y=24); x5:=LastValue(Highest(C*x*(y=25)))*(y=25); x6:=LastValue(Highest(C*x*(y=26)))*(y=26); x7:=LastValue(Highest(C*x*(y=27)))*(y=27); x8:=LastValue(Highest(C*x*(y=28)))*(y=28); x9:=LastValue(Highest(C*x*(y=29)))*(y=29); x10:=LastValue(Highest(C*x*(y=30)))*(y=30); x03:=x1+x2+x3+x4+x5+x6+x7+x8+x9+x10; x1:=LastValue(Highest(C*x*(y=31)))*(y=31); x2:=LastValue(Highest(C*x*(y=32)))*(y=32); x3:=LastValue(Highest(C*x*(y=33)))*(y=33); x4:=LastValue(Highest(C*x*(y=34)))*(y=34); x5:=LastValue(Highest(C*x*(y=35)))*(y=35); x6:=LastValue(Highest(C*x*(y=36)))*(y=36); x7:=LastValue(Highest(C*x*(y=37)))*(y=37); x8:=LastValue(Highest(C*x*(y=38)))*(y=38); x9:=LastValue(Highest(C*x*(y=39)))*(y=39); x04:=x1+x2+x3+x4+x5+x6+x7+x8+x9; x:=x01+x02+x03+x04; x:=x+BarsSince(x>0); x ---8<------------------------------------- ========================================= Australian equity options Expiration Days ========================================= ---8<------------------------------------- {Last calendar Friday of month} Fri:=OptionExp()=22; {Last calendar Thursday of month} Thu:=OptionExp()=23; {Plot in own window} -Fri*.5;Thu ---8<------------------------------------- http://www.metastocktools.com