Skip to content

Break between db and broker #836

Discussion options

You must be logged in to vote

Perhaps confusingly, the dates in 'positions in DB' are actually coming from IB. Follow the logic:

def get_my_positions(data):
    data_broker = dataBroker(data)
    my_positions = data_broker.get_db_contract_positions_with_IB_expiries().as_pd_df()
    my_positions = my_positions.sort_values("instrument_code")

    return my_positions

This is done to avoid the edge case when an expiry date hasn't been updated in the database.

(We can have a further discusison about how likely this is, and whether the unexpected nature of this behaviour is worth changing it)

So what has probably happened is that IB has provided a different contract expiry date for the same contract within a minute or so.…

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@TobiasAntiGravity
Comment options

@TobiasAntiGravity
Comment options

@meldinman
Comment options

Answer selected by robcarver17
Comment options

You must be logged in to vote
2 replies
@tgibson11
Comment options

@oldlore
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants