-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
bugsomething brokensomething broken
Description
def build_range_breaks(start_dt, end_dt):
range_breaks = [
dict(bounds=["sat", "mon"]),
# # 午休
dict(bounds=[11.51, 13.5], pattern="hour"),
#
# # 小节间休息
dict(bounds=[10.26, 10.5], pattern="hour"), # 10+15/60 = 10.25
#
# # 非交易时段(适用于有夜盘品种)
dict(bounds=[15.01, 21], pattern="hour"), # 白盘收盘到夜盘开盘
dict(bounds=[23.01, 9], pattern="hour"), # 夜盘23点后到次日9点
# 节假日
dict(values=['2024-02-10', '2024-02-11', '2024-02-12', '2024-02-13', '2024-02-14'])
]
# 添加节假日
holidays = [
d.strftime("%Y-%m-%d")
# pd.to_datetime(d)
for d in cc.get_holidays(start_dt, end_dt, include_weekends=False)
]
print(holidays)
# if holidays:
# range_breaks.append(dict(values=holidays, dvalue=24*60*60*1000))
print(range_breaks)
return range_breaks
fig.update_xaxes(
rangebreaks= build_range_breaks(df_sbar.index[0],df_sbar.index[-1]),
)
只要加上节假日,图表就不显示了,什么原因?各种写法都尝试了,都有这个问题
环境:
plotlty 6.5 在jupyter中使用,python3.13
Metadata
Metadata
Assignees
Labels
bugsomething brokensomething broken