Skip to content

Instantly share code, notes, and snippets.

@mementum
Created July 22, 2019 22:00
Show Gist options
  • Save mementum/e44671439986da352ec5defe08958914 to your computer and use it in GitHub Desktop.
Save mementum/e44671439986da352ec5defe08958914 to your computer and use it in GitHub Desktop.
class NetPayOutData(bt.feeds.GenericCSVData):
lines = ('npy',) # add a line containing the net payout yield
params = dict(
npy=6, # npy field is in the 6th column (0 based index)
dtformat='%Y-%m-%d', # fix date format a yyyy-mm-dd
timeframe=bt.TimeFrame.Months, # fixed the timeframe
openinterest=-1, # -1 indicates there is no openinterest field
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment