I’ve run into an issue and am looking for guidance from a few veterans. I’ve written a program in python that I’d like to run only periodically. I’m going to upload it to my sever, and what I’d like for it to do is to run every Monday through Friday, and every 5 minutes between 9:30 and 4.
Basically I’ve written modules to query the market, and evaluate securities that I own. I don’t want to tax the servers, so every 5 minutes should be fine.
What I want is some advice on how I should arrange the main sequence. Should I run the program from a continuous loop that just checks the time? Or should I run the code, scheduled from a daemon? Thoughts?
Unless there is any true reason for keeping the application running 24/7 (data consistency or such) I’d really recommend you to use a daemon to fire it up according to some schedule.
Your application should focus on querying the market in an efficient manner, not keeping track of when to do this.
Note: Just be careful so that you don’t start a new instance to often, before the previous instance of your python script has finished. “do one thing, and do it well” comes into mind here.