How to run a python program only at specific hours with AWS

29 Views Asked by At

I have a python trading bot that needs to run only durring market hours (9:30-4:30) and it needs to stop and start automatically. How can I do this?

Thank you in advance!

I looked through the AWS website and could not find anything.

1

There are 1 best solutions below

1
Felix Koech On

to achieve this is by using Python's schedule library along with a system-level task scheduler like cron on Unix-based systems or Task Scheduler on Windows

You need to follow the following steps: #install the sheduler library pip install schedule

#write you trade bot script and make sure that it contain trade logic and be able to interact with the market and perform trading operations.