调整金额
This commit is contained in:
@@ -63,6 +63,15 @@ def get_history_records(data_dirs):
|
||||
return all_records
|
||||
|
||||
|
||||
def generate_time_series(start, end):
|
||||
current = start
|
||||
series = []
|
||||
while current <= end:
|
||||
series.append(current)
|
||||
current += timedelta(minutes=5)
|
||||
return series
|
||||
|
||||
|
||||
def main(next_period_time, df):
|
||||
entry = {
|
||||
"id": next_period_time.strftime('%Y%m%d%H%M'),
|
||||
@@ -77,22 +86,37 @@ def main(next_period_time, df):
|
||||
if next_period_time.strftime('%H:%M:%S') in EMPTY_TIME_WINDOWS:
|
||||
return entry
|
||||
|
||||
result = []
|
||||
predictor = LotteryPredictorV14Profit()
|
||||
|
||||
next_period_time = pd.to_datetime(next_period_time)
|
||||
recent_x = df[df['time'] < next_period_time].tail(10000)
|
||||
predictor.check_init_daily_pnl_tracker(next_period_time)
|
||||
predictions = predictor.predict(next_period_time, recent_x)
|
||||
start_time, _ = predictor.check_init_daily_pnl_tracker(next_period_time)
|
||||
time_series = generate_time_series(start_time, next_period_time)
|
||||
|
||||
for pos, nums_bet in predictions.items():
|
||||
if not nums_bet:
|
||||
continue
|
||||
entry['result'][pos] = nums_bet
|
||||
for dt in time_series:
|
||||
entry = {
|
||||
"id": dt.strftime('%Y%m%d%H%M'),
|
||||
"time": dt.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
"result": {i: {n: None for n in range(1, 11)} for i in range(10)},
|
||||
"result_detail": {i: {"单": None, "双": None, "大": None, "小": None} for i in range(10)},
|
||||
"winner": {},
|
||||
"GD1": {"冠亚大": None, "冠亚小": None},
|
||||
"GD2": {"冠亚单": None, "冠亚双": None},
|
||||
"GLH_result": {}
|
||||
}
|
||||
current_time = pd.to_datetime(dt)
|
||||
recent_x = df[df['time'] < current_time].tail(10000)
|
||||
predictions = predictor.predict(current_time, recent_x)
|
||||
|
||||
last_result = df[df['time'] == next_period_time]
|
||||
if last_result.size != 0:
|
||||
predictor.update_result(last_result, entry)
|
||||
return entry
|
||||
for pos, nums_bet in predictions.items():
|
||||
if not nums_bet:
|
||||
continue
|
||||
entry['result'][pos] = nums_bet
|
||||
|
||||
last_result = df[df['time'] == current_time]
|
||||
if last_result.size != 0:
|
||||
predictor.update_result(last_result, entry)
|
||||
result.append(entry)
|
||||
return result[-1]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -101,7 +125,7 @@ if __name__ == "__main__":
|
||||
all_records = get_history_records(data_dirs)
|
||||
parser = argparse.ArgumentParser(description="下一期时间 next_period_time, 例: 2026-01-02 06:00:00")
|
||||
# 必选位置参数(直接传入值,无需前缀)
|
||||
parser.add_argument("--next_period_time", type=str, help="下一期时间, 例: 2026-01-02 06:00:00", default="2026-01-02 06:00:00")
|
||||
parser.add_argument("--next_period_time", type=str, help="下一期时间, 例: 2026-01-02 06:00:00", default="2026-01-02 07:05:00")
|
||||
args = parser.parse_args()
|
||||
fmt = "%Y-%m-%d %H:%M:%S"
|
||||
next_period_time = datetime.strptime(args.next_period_time, fmt)
|
||||
|
||||
Reference in New Issue
Block a user