@@ -164,6 +164,13 @@ def contract_detail(
|
||||
"change": r.change,
|
||||
})
|
||||
|
||||
pos_totals = {
|
||||
"long": sum(r.change for r in rankings if r.data_type == "long"),
|
||||
"short": sum(r.change for r in rankings if r.data_type == "short"),
|
||||
}
|
||||
else:
|
||||
pos_totals = {"long": 0, "short": 0}
|
||||
|
||||
# Predict next trading day amplitude: mean of latest 5 diffs
|
||||
# Compute next trading date
|
||||
next_date = latest.date + timedelta(days=1) if latest else None
|
||||
@@ -186,6 +193,7 @@ def contract_detail(
|
||||
pos_dates=pos_dates,
|
||||
selected_pos_date=selected_date,
|
||||
pos_data=pos_data,
|
||||
pos_totals=pos_totals,
|
||||
next_amp=next_amp,
|
||||
next_date=next_date.strftime("%Y/%-m/%-d") if next_date else None,
|
||||
next_weekday=WEEKDAY_ZH.get(next_date.weekday(), "") if next_date else "",
|
||||
|
||||
Reference in New Issue
Block a user