New market hours code #845
Replies: 8 comments 7 replies
-
A good way of testing this is to run interactive_diagnostics/1: view instrument_configuration/12: view trading hours for all instruments. |
Beta Was this translation helpful? Give feedback.
-
Let me look at this tomorrow
The code needs refactoring anyway as its a bit of a spaghetti clump
…On Wed, 16 Nov 2022, 18:05 Todd Gibson, ***@***.***> wrote:
This worked for me
return preceeding_midnight_of_datetime(some_datetime + datetime.timedelta(days=1))
—
Reply to this email directly, view it on GitHub
<#845 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCLPEV4YO5GU2UFOFHKP7TWIUO77ANCNFSM6AAAAAASCOQZKI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
This is now working for me with the suggested change, and I've also refactored the hell out of it so it's actually quite pleasant to look at now. |
Beta Was this translation helpful? Give feedback.
-
Looks like it's working for me too. Thanks for all your work on this. |
Beta Was this translation helpful? Give feedback.
-
This is excellent, thank you, working for me as well. What are your thoughts on a script that calculates the conservative (or, liquid) trading hour time ranges for each instrument based on a 24hr histogram of daily volume averaged over the past month for said instr? It could be used periodically to populate the private_config_trading_hours.yaml with sufficiently liquid hours for each instrument. Do you think this would be something worth doing or will I not see much benefit over the hardcoded timezone-based values? For those of you in US EST, this is the contents of my private/private_config_trading_hours.yaml that worked for me - it is a straight conversion of Carver's GMT conservative hours into EST - note that you cannot make a single definition of a range spanning midnight, such as 20:00 - 01:00am. This should be broken into two ranges:
|
Beta Was this translation helpful? Give feedback.
-
Hello All (TLDR: getting no english on the Korea trading hours running the diagnostic) Thanks for all the work on this, a question :
IB shows the contracts trade on the JAPAN Time Zone Is there an additional zone that need to be put into the the list?
|
Beta Was this translation helpful? Give feedback.
-
I don't get this problem, but here is how you can diagnose:
I'm guessing there is no overlap between your Japan timezones and when KR trades? |
Beta Was this translation helpful? Give feedback.
-
I hate to raise this issue again, but I noticed a few days ago that my trading hours were all screwed up. Not sure why, as I hadn't made any changes to the system. I've been using Rob's default trading hours with the GMT offset of -5 for EST and it was working well. I thought it might be Christmas messing everything up, but the times for 12/27 onwards are wrong. Most of the trouble seems to be in the Japan, Korea instruments. (Korea just a blank). Thanks and Happy Holidays! Addendum: Woke up 12/25 and ran the report again and everything is back to normal. I assume this was something related to IB due to the holidays (I hope). |
Beta Was this translation helpful? Give feedback.
-
Latest release hopefully puts to bed all the problems with working in different timezones and allows maximum flexibility with configuring trading hours. Basically it replaces the old hardcoded 'conservative_trading_hours' and allows you to configure the conservative trading hours by timezone, or individual instrument.
Easiest way to explain it is to examine /sysbrokers/IB/ib_config_trading_hours.yaml
This seems to work for me, but then I am on UTC. So please give it a go.
Note that by default this will give you the same conservative values I use for UTC without any time zone adjustement
If you want to change these, set up a
private.private_config_trading_hours.yaml
which is a copy of the original file and modify accordingly (you don't need to copy the header text, or the examples for individual instruments).Beta Was this translation helpful? Give feedback.
All reactions