Has anyone had any issues with the GetATMOption method? I am writing a Max Pain script, and for the most part, it is working pretty well, but there are some random Expiration Dates that the GetATMOption method just will not detect, but they exist in the Options Chain.
This code is pretty simple, yet it does not work. Does anyone else have trouble with this snippet of code? It works if I set the expiration to 20230531, but not 20230530, however, according to the Options Chain in TOS, there is an entire series of Options with an expiration date of 20230530. This is really the only issue I have left to work out with the script I have written. Once I get it ironed out I will post it, in the event anyone else wants it.
input expirationDate = 20230530;
AddLabel(IsOptionable(), GetATMOption(GetUnderlyingSymbol(), expirationDate, OptionClass.PUT));
This code is pretty simple, yet it does not work. Does anyone else have trouble with this snippet of code? It works if I set the expiration to 20230531, but not 20230530, however, according to the Options Chain in TOS, there is an entire series of Options with an expiration date of 20230530. This is really the only issue I have left to work out with the script I have written. Once I get it ironed out I will post it, in the event anyone else wants it.
input expirationDate = 20230530;
AddLabel(IsOptionable(), GetATMOption(GetUnderlyingSymbol(), expirationDate, OptionClass.PUT));