Computes binary trading signals from OHLCV data. Uses rolling mean comparison: signal = 1 if close > rolling mean, else 0.
pip install -r requirements.txtpython run.py --input data.csv --config config.yaml --output metrics.json --log-file run.logOr with defaults (no args):
python run.pyAll CLI options:
python run.py --helppython -m pytest tests/ -vStart Docker Desktop first, then:
docker build -t mlops-task .
docker run --rm mlops-taskContainer generates metrics.json and run.log.
| Key | Description | Default |
|---|---|---|
seed |
Random seed for reproducibility | 42 |
window |
Rolling mean window size | 5 |
version |
Output version string | v1 |
Success:
{
"version": "v1",
"rows_processed": 10000,
"metric": "signal_rate",
"value": 0.4991,
"latency_ms": 16,
"seed": 42,
"status": "success"
}Error:
{
"version": "v1",
"status": "error",
"error_message": "description"
}After JSON, a summary line is printed:
Done: 10000 rows, 9996 signals, rate=0.4991, 22ms
.
├── run.py
├── config.yaml
├── data.csv
├── requirements.txt
├── Dockerfile
├── metrics.json
├── run.log
├── app/
│ ├── __init__.py
│ ├── config_loader.py
│ ├── validator.py
│ ├── signal_generator.py
│ ├── metrics_writer.py
│ └── logger.py
├── tests/
│ ├── test_config.py
│ ├── test_validation.py
│ ├── test_signal_generation.py
│ ├── test_metrics_writer.py
│ └── test_integration.py
└── docs/
├── adr/0001-drop-nan-rolling-mean-rows.md
└── plan/{SCOPE,ROADMAP,IMPLEMENTATION_PLAN}.md