Skip to content

Instantly share code, notes, and snippets.

@Ichinga-Samuel
Created November 24, 2024 10:47
Show Gist options
  • Select an option

  • Save Ichinga-Samuel/2f38463b2cf372c350fa219d81289c4a to your computer and use it in GitHub Desktop.

Select an option

Save Ichinga-Samuel/2f38463b2cf372c350fa219d81289c4a to your computer and use it in GitHub Desktop.
from datetime import time
from aiomql import Session, Sessions, Chaos, ForexSymbol
# Create individual sessions
# time is in 24-hour format and in UTC
session1 = Session(start=time(8),
end=time(16),
on_start="close_all",
on_end="close_all",
name="London")
session2 = Session(start=time(13), end=time(22, 0), name="New York")
# Combine sessions into a Sessions object
sessions = Sessions(sessions=[session1, session2])
# Create a Chaos Strategy
eur = ForexSymbol(name="EURUSD")
chaos = Chaos(sessions=sessions, symbol=eur)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment