Skip to content

Instantly share code, notes, and snippets.

@HumanRupert
Created June 11, 2021 13:44
Show Gist options
  • Save HumanRupert/43904fe7a731e39cb52c9117ac4d7b62 to your computer and use it in GitHub Desktop.
Save HumanRupert/43904fe7a731e39cb52c9117ac4d7b62 to your computer and use it in GitHub Desktop.
def initialize(context):
# avoid out of bounds error by dropping firstBottomDate col
patterns = pd.read_csv("data/patterns.csv").drop(["firstBottomDate"], axis=1)
patterns = convert_date_cols(patterns)
context.patterns = patterns
tickers = pd.read_csv("data/tickers.csv")
tickers = convert_date_cols(tickers)
context.stocks = [zp.api.symbol(ticker) for ticker in tickers.symbol]
context.position_dates = {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment