Automated emails based on price spreads

Suppose there are related securities, such as two preferred stocks of the same company, whose price difference should trade in a narrow band. How would you poll the market at a relatively low frequency (say every 5 minutes) and send an email when the price spread is outside a specified band? Since preferred stocks are pretty illiquid I am not looking to fully automate execution but to get alerts.
 
Are you asking people what they, themselves, would personally do? Because, if not, you're going to have to be more specific regarding your task and expectations... like what kind of computer do you have? Who is providing the data/quotes? And what about your email service?

And one last really important question... how much does this job pay? Lol
 
subscribe to some datafeed
configure stock pairs and thresholds
onMarketData() determine if threshold breached
send email. I think you can send to gmail or any free account

would take at most half a day, maybe half an hour
 
  • Like
Reactions: N2M
I'm just winging this
if (stock_price_a - stock_price_b) < x:
send email
You probably want to check the absolute difference and make sure it's greater than some epsilon. But you're off to a good start! Lol
 
  • Like
Reactions: N2M
Back
Top