Skip to content

Commit

Permalink
update warns
Browse files Browse the repository at this point in the history
  • Loading branch information
崔子琦 committed Aug 12, 2022
1 parent 286c8bd commit 08ba169
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rqalpha/mod/rqalpha_mod_sys_scheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@


def market_close(hour=0, minute=0):
if Environment.get_instance().config.base.accounts.get("STOCK") is None:
system_log.warning("market_close using in stock market")
if Environment.get_instance().config.base.accounts.get(DEFAULT_ACCOUNT_TYPE.FUTURE):
system_log.warning("using 'market_close' in futures/option strategy is not recommended")
minutes_since_midnight = 15 * 60 - hour * 60 - minute
if minutes_since_midnight < 13 * 60:
minutes_since_midnight -= 90
return minutes_since_midnight


def market_open(hour=0, minute=0):
if Environment.get_instance().config.base.accounts.get("STOCK") is None:
system_log.warning("market_open using in stock market")
if Environment.get_instance().config.base.accounts.get(DEFAULT_ACCOUNT_TYPE.FUTURE):
system_log.warning("using 'market_open' in futures/option strategy is not recommended")
minutes_since_midnight = 9 * 60 + 31 + hour * 60 + minute
if minutes_since_midnight > 11 * 60 + 30:
minutes_since_midnight += 90
Expand Down

0 comments on commit 08ba169

Please sign in to comment.