Added expiry property for OptionPair
parent
19b4ca9d85
commit
ddffe2bec6
|
@ -116,6 +116,12 @@ class OptionPair(Pair, frozen=True, kw_only=True):
|
|||
# NOTE: see `.data._symcache.SymbologyCache.load()` for why
|
||||
ns_path: str = 'piker.brokers.deribit:OptionPair'
|
||||
|
||||
@property
|
||||
def expiry(self) -> str:
|
||||
symbol: str = self.instrument_name.lower()
|
||||
pair, expiry, strike_price, otype = symbol.split('-')
|
||||
return f'{expiry}'
|
||||
|
||||
@property
|
||||
def venue(self) -> str:
|
||||
return 'OPTION'
|
||||
|
|
Loading…
Reference in New Issue