I have never automated a strategy and want to write the following rule.
I want to select a SPY Call to Buy. It should have a strike closest to a delta of 50 and be between 0-10 days from expiration.
Assistance is greatly appreciated.
Here is the template I have started with.
https://www.quantopian.com/algorithms/568878bd99e1dc1d1a000335