From 87d611595486c0958c23f0a310614a2956d44985 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 29 Jun 2023 12:21:53 -0400 Subject: [PATCH] Add src asset name ignore via `MktPair._fqme_without_src: bool` --- piker/accounting/_mktinfo.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/piker/accounting/_mktinfo.py b/piker/accounting/_mktinfo.py index c1f14f9f..6cab676b 100644 --- a/piker/accounting/_mktinfo.py +++ b/piker/accounting/_mktinfo.py @@ -290,6 +290,10 @@ class MktPair(Struct, frozen=True): _atype: str = '' + # allow explicit disable of the src part of the market + # pair name -> useful for legacy markets like qqq.nasdaq.ib + _fqme_without_src: bool = False + # NOTE: when cast to `str` return fqme def __str__(self) -> str: return self.fqme @@ -486,7 +490,7 @@ class MktPair(Struct, frozen=True): ''' key: str = ( self.pair(delim_char=delim_char) - if not without_src + if not (without_src or self._fqme_without_src) else str(self.dst) )