mirror of
https://github.com/bspeice/metrik
synced 2024-12-24 22:48:10 -05:00
Add State Street holdings to the EquitiesFlow
I mean, I know it's all ETF's, but they have a lot of equities!
This commit is contained in:
parent
d48649c565
commit
086e893054
@ -1,2 +1,2 @@
|
||||
__version__ = '0.3.9'
|
||||
__version__ = '0.4.0'
|
||||
__release__ = __version__
|
@ -8,4 +8,21 @@ mongo_database=metrik
|
||||
consumer_key=
|
||||
consumer_secret=
|
||||
oauth_token=
|
||||
oauth_token_secret=
|
||||
oauth_token_secret=
|
||||
|
||||
[statestreet]
|
||||
etf_holdings:
|
||||
# Dow Jones
|
||||
DIA,
|
||||
# Russell 1000, 2000, 3000
|
||||
ONEK,TWOK,THRK,
|
||||
# S&P 500, small-cap, mid-cap, and growth
|
||||
SPY,SLY,MDY,SPYG,
|
||||
# Sector-specific
|
||||
XLY,XLP,XLE,XLF,XLFS,XLV,XLB,XLRE,XLK,XLU,
|
||||
# Smart-beta
|
||||
SPYD,ONEV,ONEO,ONEY,SPYB,
|
||||
# Active ETFs
|
||||
SYE,SYG,SYV,
|
||||
# Environmental, Social, Governance
|
||||
LOWC,SPYX,SHE
|
@ -1,6 +1,8 @@
|
||||
from metrik.flows.base import Flow, MarketClose
|
||||
from metrik.tasks.nasdaq import NasdaqETFList, NasdaqCompanyList
|
||||
from metrik.tasks.tradeking import Tradeking1mTimesales
|
||||
from metrik.tasks.state_street import StateStreetHoldings
|
||||
from metrik.conf import get_config
|
||||
|
||||
|
||||
class EquitiesFlow(Flow):
|
||||
@ -12,6 +14,8 @@ class EquitiesFlow(Flow):
|
||||
return MarketClose()
|
||||
|
||||
def _run(self):
|
||||
config = get_config()
|
||||
|
||||
# When we yield dependencies in `run` instead of `_requires`,
|
||||
# they get executed dynamically and we can use their results inline
|
||||
etfs = NasdaqETFList(current_datetime=self.present, live=self.live)
|
||||
@ -32,3 +36,11 @@ class EquitiesFlow(Flow):
|
||||
symbol=c['Symbol']
|
||||
) for c in companies.output().retrieve()['companies']]
|
||||
yield tradeking_companies
|
||||
|
||||
state_street_etfs = config.get('statestreet', 'etf_holdings')
|
||||
state_street_holdings = [
|
||||
StateStreetHoldings(current_datetime=self.present, live=self.live,
|
||||
ticker=t.strip())
|
||||
for t in state_street_etfs.split(',')
|
||||
]
|
||||
yield state_street_holdings
|
||||
|
Loading…
Reference in New Issue
Block a user