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
|
# NOTE: see `.data._symcache.SymbologyCache.load()` for why
|
||||||
ns_path: str = 'piker.brokers.deribit:OptionPair'
|
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
|
@property
|
||||||
def venue(self) -> str:
|
def venue(self) -> str:
|
||||||
return 'OPTION'
|
return 'OPTION'
|
||||||
|
|
Loading…
Reference in New Issue