@rakeshr@sujith - Hello, how can we set a timer to Algo program, ie it can start once a specified time condition meets and stops same way? Below a part of the code. It doesn't work, I noticed the program keeps running after exit time condition. Can someone assist what is needed to solve this issue?
while True:
now = datetime.datetime.now() if (now.hour >= 13 and now.minute >= 10 ): kws.on_ticks=on_ticks kws.on_connect=on_connect kws.connect() if (now.hour >= 14 and now.minute >= 00): sys.exit()
now = datetime.datetime.now()
if (now.hour >= 13 and now.minute >= 10 and started ==False ):
kws.on_ticks=on_ticks
kws.on_connect=on_connect
kws.connect(threaded=True)
started=True
elif (now.hour >= 14 and now.minute >= 00):
sys.exit()
while True:
now = datetime.datetime.now()
if (now.hour >= 13 and now.minute >= 10 and started ==False ):
kws.on_ticks=on_ticks
kws.on_connect=on_connect
kws.connect(threaded=True)
started=True
elif (now.hour >= 14 and now.minute >= 00):
sys.exit()
This code might work for you