From 0fe6181e7ce49f66c78cc2fa92113f6816326e60 Mon Sep 17 00:00:00 2001 From: moshferatu Date: Thu, 7 Dec 2023 08:12:50 -0800 Subject: [PATCH] Add iron condor trade scheduler script --- iron_condor_scheduler.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 iron_condor_scheduler.py diff --git a/iron_condor_scheduler.py b/iron_condor_scheduler.py new file mode 100644 index 0000000..6826448 --- /dev/null +++ b/iron_condor_scheduler.py @@ -0,0 +1,20 @@ +import schedule +import time + +from iron_condor import enter_iron_condor +from multiprocessing import Process + +# TODO: Look up entry times from database. +entry_times = [] + +def enter_trade(): + job_process = Process(target = enter_iron_condor) + job_process.start() + +if __name__ == '__main__': + for entry_time in entry_times: + schedule.every().day.at(entry_time, 'America/Los_Angeles').do(enter_trade) + + while True: + schedule.run_pending() + time.sleep(1) \ No newline at end of file