Add offline workflow and coverage tests
This commit is contained in:
@@ -160,7 +160,8 @@ def reversal_vol(data_path, output_dir, lookback, vol_window):
|
||||
@alpha.command("eval")
|
||||
@click.option("--alpha-path", required=True, help="Path to alpha parquet file")
|
||||
@click.option("--data-path", required=True, help="Path to data parquet (for price data)")
|
||||
def eval_(alpha_path, data_path):
|
||||
@click.option("--report-dir", default="reports", help="Directory to save JSON report")
|
||||
def eval_(alpha_path, data_path, report_dir):
|
||||
"""Evaluate an alpha's performance (return, Sharpe, turnover).
|
||||
|
||||
Alphas are interpreted as position WEIGHTS, not return predictors.
|
||||
@@ -183,9 +184,9 @@ def eval_(alpha_path, data_path):
|
||||
click.echo("=" * 50)
|
||||
|
||||
# Also dump JSON
|
||||
os.makedirs("reports", exist_ok=True)
|
||||
os.makedirs(report_dir, exist_ok=True)
|
||||
alpha_name = alpha_df["alpha_name"].iloc[0]
|
||||
json_path = f"reports/{alpha_name}_eval.json"
|
||||
json_path = os.path.join(report_dir, f"{alpha_name}_eval.json")
|
||||
with open(json_path, "w") as f:
|
||||
json.dump(metrics, f, indent=2)
|
||||
click.echo(f"\nReport saved: {json_path}")
|
||||
|
||||
Reference in New Issue
Block a user