fix: replace unicode chars that break Windows cp1252 encoding

This commit is contained in:
BizzleBot
2026-03-19 22:25:40 +00:00
parent b467445708
commit d81d1dedac
3 changed files with 88 additions and 4 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
BTC ML Trading Strategy Train & Backtest Engine
BTC ML Trading Strategy -- Train & Backtest Engine
Self-contained script that runs on the Windows PC with GPU.
Usage:
@@ -280,7 +280,7 @@ def walk_forward_train_test(df: pd.DataFrame, feature_cols: list, config: dict)
try:
model.fit(X_train, y_train)
except Exception as e:
print(f" Window {w+1}: training failed {e}", file=sys.stderr)
print(f" Window {w+1}: training failed -- {e}", file=sys.stderr)
continue
# Get predictions on test set
@@ -492,7 +492,7 @@ def compile_results(trades: list, per_window_sharpe: list,
# ---------------------------------------------------------------------------
def main():
parser = argparse.ArgumentParser(description="BTC ML Trading Train & Backtest")
parser = argparse.ArgumentParser(description="BTC ML Trading -- Train & Backtest")
parser.add_argument("--config", required=True, help="Path to config JSON")
parser.add_argument("--data", required=True, help="Path to OHLCV CSV")
parser.add_argument("--output", required=True, help="Path to output results JSON")
@@ -505,7 +505,7 @@ def main():
# Load data
print(f"Loading data from {args.data}...")
df = pd.read_csv(args.data, parse_dates=["timestamp"])
print(f" {len(df)} rows, {df['timestamp'].iloc[0]} {df['timestamp'].iloc[-1]}")
print(f" {len(df)} rows, {df['timestamp'].iloc[0]} -> {df['timestamp'].iloc[-1]}")
# Compute features
print("Computing features...")