Files
ai-exchange/scripts/run_execution.py
T
2026-04-24 13:39:01 +08:00

27 lines
723 B
Python

from pathlib import Path
import sys
ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from src.services.execution import ExecutionService
def main() -> None:
service = ExecutionService()
signal_id = 1
decision = service.prepare_execution(signal_id=signal_id, execution_mode="paper")
if decision is None:
print("Signal not found")
return
execution_id = service.create_execution(signal_id=signal_id, execution_mode="paper")
print(
f"Execution allowed: {decision.allowed}; status: {decision.status}; "
f"reasons: {decision.reasons}; execution_id: {execution_id}"
)
if __name__ == "__main__":
main()