Normalize fullwidth punctuation to ASCII across codebase.
Add scripts/normalize_ambiguous_unicode.py; fix corrupted patch_instance_theme_templates.py. Preserves curly quotes in string literals; removes Git homoglyph warnings on .env.example. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""交易复盘 / 订单 K 线拼图(Binance / Gate / OKX 共用)。"""
|
||||
"""交易复盘 / 订单 K 线拼图(Binance / Gate / OKX 共用)."""
|
||||
|
||||
import math
|
||||
|
||||
@@ -148,11 +148,11 @@ def _to_int_ms(value):
|
||||
|
||||
def trade_review_fetch_window(entry_ts_ms, exit_ts_ms, timeframe, limit, anchor=None, now_ms=None):
|
||||
"""
|
||||
复盘 K 线窗口(anchor=close):
|
||||
- 有开/平仓:从开仓前若干根起,到平仓 K 线止(覆盖整笔交易 + 入场前背景)
|
||||
- 仅开仓:以开仓时间为终点向前 limit 根
|
||||
- 仅平仓:以平仓时间为终点向前 limit 根
|
||||
anchor=now:以当前时间为终点向前 limit 根(可看平仓后走势)
|
||||
复盘 K 线窗口(anchor=close):
|
||||
- 有开/平仓:从开仓前若干根起,到平仓 K 线止(覆盖整笔交易 + 入场前背景)
|
||||
- 仅开仓:以开仓时间为终点向前 limit 根
|
||||
- 仅平仓:以平仓时间为终点向前 limit 根
|
||||
anchor=now:以当前时间为终点向前 limit 根(可看平仓后走势)
|
||||
"""
|
||||
period = timeframe_period_ms(timeframe)
|
||||
lim = max(2, int(limit))
|
||||
@@ -224,7 +224,7 @@ def trim_rows_for_trade_review(rows, window):
|
||||
|
||||
|
||||
def parse_journal_chart_timeframes(tf1, tf2, fallback_tfs=None):
|
||||
"""复盘表单:最多两个周期,去重保序。"""
|
||||
"""复盘表单:最多两个周期,去重保序."""
|
||||
out = []
|
||||
for raw in (tf1, tf2):
|
||||
tf = normalize_chart_timeframe(raw)
|
||||
@@ -274,7 +274,7 @@ def render_candles_subplot(
|
||||
price_levels=None,
|
||||
):
|
||||
if not Image or not ImageDraw:
|
||||
raise RuntimeError("缺少依赖:Pillow(pip install Pillow)")
|
||||
raise RuntimeError("缺少依赖:Pillow(pip install Pillow)")
|
||||
img = Image.new("RGB", (width, height), bg_rgb)
|
||||
draw = ImageDraw.Draw(img)
|
||||
font = _load_font(14)
|
||||
|
||||
Reference in New Issue
Block a user