mirror of
https://github.com/QuantEngines/fx_quant_engine.git
synced 2026-07-28 02:47:50 +00:00
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
from __future__ import annotations
|
|
|
|
import json
|
|
from datetime import datetime, timedelta, timezone
|
|
from pathlib import Path
|
|
|
|
from options_quant_engine import OptionsQuantEngine
|
|
|
|
|
|
def main() -> None:
|
|
root = Path(__file__).resolve().parents[1]
|
|
engine = OptionsQuantEngine(config_dir=root / "config")
|
|
|
|
end = datetime.now(timezone.utc)
|
|
start = end - timedelta(days=260)
|
|
|
|
assets = ["USDINR", "EURINR", "GBPINR", "JPYINR", "EURUSD", "USDJPY"]
|
|
out_dir = root / "examples" / "runs"
|
|
out_dir.mkdir(parents=True, exist_ok=True)
|
|
|
|
outputs = {}
|
|
for asset in assets:
|
|
outputs[asset] = engine.run_asset(asset, start, end)
|
|
|
|
rv = engine.run_relative_value("USDJPY", "EURUSD", start, end)
|
|
outputs["relative_value"] = rv
|
|
|
|
ts = datetime.now(timezone.utc).strftime("%Y%m%d_%H%M%S")
|
|
out_file = out_dir / f"engine_run_{ts}.json"
|
|
out_file.write_text(json.dumps(outputs, indent=2), encoding="utf-8")
|
|
print(f"Saved engine output to {out_file}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|