Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
Bruce,
Can we write a code that recognizes the option expiration days? Friday before the 3rd Sat of every month.
thx
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I don't know anything about options, but assuming you are correct and that the Option Expiration is always the Friday before the 3rd Saturday of every month, then it would seem to me that any Friday that is also the 14th, 15th, 16th, 17th, 18th, 19th or 20th of month would be an Option Expiration date. If so, the following RealCode Rule should work (although Market Holidays might mess with these assumptions):
If 14 <= Price.DateValue.Day AndAlso _
Price.DateValue.Day <= 20 AndAlso _
Price.DateValue.DayOfWeek = 5 Then Pass
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
Bruce
My bad its the 3rd friday of every month it has nothing do with Sat in this case.
How can I just change this to the 3rd friday?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I would think that would just change the day of the month range from 14-20 to 15-21:
If 15 <= Price.DateValue.Day AndAlso _
Price.DateValue.Day <= 21 AndAlso _
Price.DateValue.DayOfWeek = 5 Then Pass
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
thx looks accurate
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/1/2009 Posts: 97
|
Market holidays may affect the last day of trading before expiration.
|
|
Guest-1 |