Skip to content

Commit

Permalink
0.9.60 fix minutes_split
Browse files Browse the repository at this point in the history
  • Loading branch information
zengbin93 committed Oct 31, 2024
1 parent a24e47f commit b196c5f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 29 deletions.
Binary file modified czsc/utils/minutes_split.feather
Binary file not shown.
67 changes: 38 additions & 29 deletions examples/develop/bar_end_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,9 @@ def split_time(freq="60分钟"):
return dfx


rows = []
for freq in (
"1分钟",
"2分钟",
"3分钟",
"4分钟",
"5分钟",
"6分钟",
"10分钟",
"12分钟",
"15分钟",
"20分钟",
"30分钟",
"60分钟",
"120分钟",
):
rows.append(split_time(freq))

df = pd.concat(rows, ignore_index=True)
df = pd.pivot_table(df, index="time", columns="freq", values="edt", aggfunc="first").reset_index()
df["market"] = "默认"
df = df[
[
"market",
"time",
def main():
rows = []
for freq in (
"1分钟",
"2分钟",
"3分钟",
Expand All @@ -97,9 +75,40 @@ def split_time(freq="60分钟"):
"30分钟",
"60分钟",
"120分钟",
):
rows.append(split_time(freq))

df = pd.concat(rows, ignore_index=True)
df = pd.pivot_table(df, index="time", columns="freq", values="edt", aggfunc="first").reset_index()
df["market"] = "默认"
df = df[
[
"market",
"time",
"1分钟",
"2分钟",
"3分钟",
"4分钟",
"5分钟",
"6分钟",
"10分钟",
"12分钟",
"15分钟",
"20分钟",
"30分钟",
"60分钟",
"120分钟",
]
]
]
df.to_excel(r"C:\Users\zengb\Desktop\time_split_conf_V4.xlsx", index=False)
df.to_excel(r"C:\Users\zengb\Desktop\time_split_conf_V4.xlsx", index=False)

df = pd.read_excel(r"C:\Users\zengb\Desktop\time_split_conf_V4.xlsx")
df.to_feather(r"D:\ZB\git_repo\waditu\czsc\czsc\utils\minites_split.feather")
df = pd.read_excel(r"C:\Users\zengb\Desktop\time_split_conf_V4.xlsx")
df.to_feather(r"D:\ZB\git_repo\waditu\czsc\czsc\utils\minites_split.feather")


def fix_error():
df = pd.read_feather(r"A:\ZB\git_repo\waditu\czsc\czsc\utils\minutes_split.feather")
df.to_excel(r"C:\Users\zengb\Desktop\time_split_conf_V4.xlsx", index=False)

df = pd.read_excel(r"C:\Users\zengb\Desktop\time_split_conf_V4.xlsx")
df.to_feather(r"A:\ZB\git_repo\waditu\czsc\czsc\utils\minutes_split.feather")

0 comments on commit b196c5f

Please sign in to comment.