27 lines
740 B
Python
27 lines
740 B
Python
"""Backtest engine plugin — historical strategy testing."""
|
|
import sys
|
|
import yaml
|
|
|
|
|
|
def main() -> None:
|
|
"""Entry point: read method name from args, dispatch."""
|
|
if len(sys.argv) < 2:
|
|
print(yaml.dump({"error": "no method specified"}))
|
|
return
|
|
|
|
method = sys.argv[1]
|
|
params = yaml.safe_load(sys.stdin.read()) if not sys.stdin.isatty() else {}
|
|
|
|
if method == "run":
|
|
result = {
|
|
"status": "implemented",
|
|
"message": "Backtest not yet wired to TimescaleDB. Configure TIMESERIES_* env vars.",
|
|
"params": params,
|
|
}
|
|
print(yaml.dump(result))
|
|
else:
|
|
print(yaml.dump({"error": f"unknown method: {method}"}))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main() |