mirror of
https://github.com/QuantEngines/fx_quant_engine.git
synced 2026-07-28 19:07:45 +00:00
Initial commit: fx_quant_engine and options_quant_engine scaffold
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user