aboutsummaryrefslogtreecommitdiffstats
path: root/python/report_ops/sma.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/report_ops/sma.py')
-rw-r--r--python/report_ops/sma.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/report_ops/sma.py b/python/report_ops/sma.py
index dc9cc1ca..4c3ae373 100644
--- a/python/report_ops/sma.py
+++ b/python/report_ops/sma.py
@@ -42,9 +42,14 @@ class SMA:
fund: ClassVar[str]
_conn: ClassVar = dbconn("dawndb")
_em: ClassVar = ExchangeMessage()
+ _registry = {}
+
+ def __class_getitem__(cls, fund):
+ return cls._registry[fund]
def __init_subclass__(cls, fund):
cls.fund = fund
+ cls._registry[fund] = cls
def get_positions(self):
df_blotter = pd.read_sql_query(
@@ -100,6 +105,10 @@ class BowdstSMA(SMA, fund="BOWDST"):
pass
+class BrinkerSMA(SMA, fund="BRINKER"):
+ pass
+
+
_sql_query = {
"bond": "SELECT * FROM risk_positions(%s, null, %s) ",
"future": (