1
0
mirror of https://github.com/bspeice/metrik synced 2024-11-04 22:48:11 -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:
Bradlee Speice 2016-09-01 14:44:06 -04:00
parent d48649c565
commit 086e893054
3 changed files with 31 additions and 2 deletions

View File

@ -1,2 +1,2 @@
__version__ = '0.3.9'
__version__ = '0.4.0'
__release__ = __version__

View File

@ -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

View File

@ -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