- Removed v10 TradingView indicator (moneyline_v10_momentum_dots.pinescript) - Removed v10 penalty system from signal-quality.ts (-30/-25 point penalties) - Removed backtest result files (sweep_*.csv) - Updated copilot-instructions.md to remove v10 references - Simplified direction-specific quality thresholds (LONG 90+, SHORT 80+) Rationale: - 1,944 parameter combinations tested in backtest - All top results IDENTICAL (568 trades, $498 P&L, 61.09% WR) - Momentum parameters had ZERO impact on trade selection - Profit factor 1.027 too low (barely profitable after fees) - Max drawdown -$1,270 vs +$498 profit = terrible risk-reward - v10 penalties were blocking good trades (bug: applied to wrong positions) Keeping v9 as production system - simpler, proven, effective.
50 lines
1.2 KiB
Python
50 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
from typing import Sequence
|
|
|
|
from pandas.compat._optional import import_optional_dependency
|
|
|
|
from pandas.core.dtypes.inference import is_list_like
|
|
|
|
from pandas.core.api import DataFrame
|
|
|
|
from pandas.io.common import stringify_path
|
|
|
|
|
|
def read_spss(
|
|
path: str | Path,
|
|
usecols: Sequence[str] | None = None,
|
|
convert_categoricals: bool = True,
|
|
) -> DataFrame:
|
|
"""
|
|
Load an SPSS file from the file path, returning a DataFrame.
|
|
|
|
.. versionadded:: 0.25.0
|
|
|
|
Parameters
|
|
----------
|
|
path : str or Path
|
|
File path.
|
|
usecols : list-like, optional
|
|
Return a subset of the columns. If None, return all columns.
|
|
convert_categoricals : bool, default is True
|
|
Convert categorical columns into pd.Categorical.
|
|
|
|
Returns
|
|
-------
|
|
DataFrame
|
|
"""
|
|
pyreadstat = import_optional_dependency("pyreadstat")
|
|
|
|
if usecols is not None:
|
|
if not is_list_like(usecols):
|
|
raise TypeError("usecols must be list-like.")
|
|
else:
|
|
usecols = list(usecols) # pyreadstat requires a list
|
|
|
|
df, _ = pyreadstat.read_sav(
|
|
stringify_path(path), usecols=usecols, apply_value_formats=convert_categoricals
|
|
)
|
|
return df
|