Hi i was wondering how to make my algorithm work only for the first hour of market. I want in fact to make it stop automatically only if i don't have any open positions. Any clue?
this is what i made but i think is not that great and is missing the second part
from datetime import datetime, timedelta
start = datetime.now()
while datetime.now() - start < timedelta(seconds=1*60*60):
perform(True)
perform(False)