fix: ECR-004 威科夫区间评分硬化与 VP 绘图减负(已审)

评分选 TR、阶段最小跨度、elements_only 门闩、Top-8 VP;无币种独立参数。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-06 18:46:08 +08:00
co-authored by Cursor
parent ac6be80278
commit d3188ca83c
19 changed files with 275 additions and 89 deletions
+5 -4
View File
@@ -656,18 +656,19 @@ def analyze():
else:
result['structure_zones'] = []
# 威科夫分析 —— 按需:include_wyckoff=1
# 威科夫分析 —— 按需:include_wyckoff=1,且须有主周期分析(非 elements_only
include_wyckoff_param = request.args.get('include_wyckoff', '')
include_wyckoff = str(include_wyckoff_param).lower() in ('1', 'true', 'yes')
if include_wyckoff:
if include_wyckoff and not elements_only:
try:
from chanlun.analysis.wyckoff import analyze_wyckoff
wyckoff_lookback = int(request.args.get('wyckoff_lookback', 120))
wyckoff_bins = int(request.args.get('wyckoff_vp_bins', 50))
# ECR-004:默认/上限 24 binsA+C
wyckoff_bins = int(request.args.get('wyckoff_vp_bins', 24))
result['wyckoff'] = analyze_wyckoff(
df,
lookback=max(40, min(wyckoff_lookback, 500)),
vp_bins=max(10, min(wyckoff_bins, 100)),
vp_bins=max(10, min(wyckoff_bins, 24)),
)
except Exception as e:
print(f"Wyckoff 分析出错: {e}")