Hello.
I want to close position before 2 days of expiratiration Futures and I need backtesting it.
I use Custom Futures for backtesting.
how to get expirationdate (for 8 futures) on history in backtesting?
functions expirationdate or expirationdatefromvendor always show current futures expriration date. I need previos futures expiration dates.
how to get expirationdate on history?
- Angelina MultiСharts
- Posts: 260
- Joined: 28 Dec 2016
- Has thanked: 28 times
- Been thanked: 66 times
Re: how to get expirationdate on history?
Hello Sir,
It is not possible to get previous futures expiration dates with expirationdate keyword, it has to be calculated
It is not possible to get previous futures expiration dates with expirationdate keyword, it has to be calculated
-
- Posts: 11
- Joined: 05 Jan 2015
- Angelina MultiСharts
- Posts: 260
- Joined: 28 Dec 2016
- Has thanked: 28 times
- Been thanked: 66 times
Re: how to get expirationdate on history?
Sorry for the delay in responding.
I'd suggest creating a function that compares the date to specified expiration dates and returns the correct one. But such function has to be adjusted for contracts with different expiration rules.
I'd suggest creating a function that compares the date to specified expiration dates and returns the correct one. But such function has to be adjusted for contracts with different expiration rules.