Retrieve entry times from environment variables

This commit is contained in:
moshferatu 2024-02-13 08:13:51 -08:00
parent afd33102bd
commit 7119af4e34

View File

@ -1,7 +1,6 @@
import schedule import schedule
import time import time
from backtesting import best_entry_times
from datetime import datetime from datetime import datetime
from dotenv import load_dotenv from dotenv import load_dotenv
from ibkr import Client from ibkr import Client
@ -33,8 +32,7 @@ if __name__ == '__main__':
now = datetime.now(timezone(eastern_timezone)) now = datetime.now(timezone(eastern_timezone))
entry_times = sorted(best_entry_times()) entry_times = getenv('ENTRY_TIMES').split(',')
print(entry_times)
for entry_time in entry_times: for entry_time in entry_times:
schedule_time = datetime.strptime(entry_time, '%H:%M:%S').replace( schedule_time = datetime.strptime(entry_time, '%H:%M:%S').replace(
year = now.year, year = now.year,