Skip to content

How to retrieve data only up to open of current trading session? #64

Answered by gnzsnz
nicholashoyy asked this question in Q&A
Discussion options

You must be logged in to vote

this looks more like "how do i get the current trading session?" question.
I use exchange calendars or eventually historical schedule

to get the open price, i usually do

ticker = ib.reqMktData(contract)
ib.sleep(1)
ticker.open

which will only work if the session is open

hope it helps

Replies: 1 comment

Comment options

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