I tried to use NextOptionExpiryDate but this function is not able to provide the correct expiry date if you are over the last bar. It will only provide the next expiry date after the last bar but not later.
For example, I need the expiry date 2 months after the last bar
CODE:
Please log in to see this code.
Thx.
Size:
Color:
Sounds like good defensive programming in NextOptionExpiryDate. Bars.Count+59 is garbage input that can only lead to an IndexOutOfRange exception. With NextOptionExpiryDate you cannot go beyond Bars.Count-1. However, NextOptionExpiryDate accepts arbitrary dates (which isn't currently documented in the QuickRef - I'll fix this):
CODE:
Please log in to see this code.
What do you think you need it for?
Size:
Color:
It works. You rock the boat! Exactly what I need.
Size:
Color:
Glad to help!
Size:
Color: