-
Notifications
You must be signed in to change notification settings - Fork 135
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
Bug in the function "is_market_open()" and possibly other functions #247
Comments
Is there any plan this will be fixed? |
Hey Timo,
This is a difficult thing for me to fix since I cannot replicate it (I’m on
the eastern timezone). If you submit a pull request fixing it I can merge
it into lumibot
Robert Grzesik 347-635-3416
…On Fri, Jan 26, 2024 at 2:30 PM Timo Friedl ***@***.***> wrote:
Is there any plan this will be fixed?
—
Reply to this email directly, view it on GitHub
<#247 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIYQKZ5QKPQGWAIOC3MTNDYQP73XAVCNFSM6AAAAAAXYDZGK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSGU4DEMJTGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I think you can use an VPN to change your IP address to another region.
|
The issue is not the ip address, it is the clock
Robert Grzesik 347-635-3416
On Tue, Jan 30, 2024 at 11:37 AM FengShengchuang ***@***.***>
wrote:
… I think you can use an VPN to change your IP address to another region.
Hey Timo, This is a difficult thing for me to fix since I cannot replicate
it (I’m on the eastern timezone). If you submit a pull request fixing it I
can merge it into lumibot Robert Grzesik 347-635-3416
… <#m_2470193497041595711_>
On Fri, Jan 26, 2024 at 2:30 PM Timo Friedl *@*.*> wrote: Is there any
plan this will be fixed? — Reply to this email directly, view it on GitHub
<#247 (comment)
<#247 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAIYQKZ5QKPQGWAIOC3MTNDYQP73XAVCNFSM6AAAAAAXYDZGK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSGU4DEMJTGY
<https://github.com/notifications/unsubscribe-auth/AAIYQKZ5QKPQGWAIOC3MTNDYQP73XAVCNFSM6AAAAAAXYDZGK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSGU4DEMJTGY>
. You are receiving this because you are subscribed to this thread.Message
ID: @.*>
—
Reply to this email directly, view it on GitHub
<#247 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIYQK4BDIOHN376Y2LBL3LYREOUFAVCNFSM6AAAAAAXYDZGK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJXGQ2DGOBSG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hi, I'm a new Lumibot user in Singapore. I found that I can't submit market order after midnight (12:00 am) local time, and in my Spyder console, it shows: Sleeping until the market opens.
After some checking, I found that in the file broker.py, there is a bug in the function is_market_open().
In this function, this line:
open_time = self.utc_to_local(self.market_hours(close=False))
gives the open time. It works as intended before midnight Singapore time say on Friday. However, when I run this line after 12 am Singapore time, it actually shows the open time of next Monday. Although the market is still open because it is at noon New York time, the variable current_time is earlier than the open time of next Monday, so this line:
return (current_time >= open_time) and (close_time >= current_time)
will return "false".
Here are some lines I run in my console and their outputs for your reference:
As I mentioned earlier, when I try to submit a market order after midnight, it shows: Sleeping until the market opens. This may mean that there is a similar issue in the function trader.run_all() or other functions it calls.
Hopefully this bug can be fixed soon.
Thanks!
Shengchuang
The text was updated successfully, but these errors were encountered: