Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pls add one model ib statement #6

Open
kamaleshvm opened this issue Jan 3, 2020 · 2 comments
Open

Pls add one model ib statement #6

kamaleshvm opened this issue Jan 3, 2020 · 2 comments

Comments

@kamaleshvm
Copy link

Please add one model ib statement or the header , so that i can modify the code for India equity market. Thanks in advance.

@MikePia
Copy link
Owner

MikePia commented Jan 28, 2020

Sorry I have been absent from github for a while. The program will already read IB statements. I am retaining only csv activity and flex activity statements in the program. This is pre alpha and the the interface will definitely change but I will be sure to leave the current stuff in place at least until beta release. I plan to abstract the database models using django db models or something similar that will enable any database to be used. But for now

# The infile could be an Activity statement or a flex activity statment
# This file on my system is one month of trades from a flex statment

infile = "flex.369463.ActivityFlexMonth.20191008.20191106.csv"
theDate = pd.Timestamp('2019-10-16')

# Create these two objects
ibs = IbStatement(db="testdb.sqlite")
ibdb = StatementDB("testdb.sqlite")

# This call loads the statement into the db
ibs.openIBStatementCSV(infile)     

# This call will then retrieve one day of transactions organized as trades. theDate is string or timestamp
df2 = ibdb.getStatement(theDate)   

Currently StatemenDB object loads up US holidays. Maybe that should change to a pluggable set of holidays?

@kamaleshvm
Copy link
Author

Thanks for your response. I will check and response to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants