Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Help: trading put options with Algo?

Hi everyone,
So I come here to see if someone can share some light with me on something.

I am trying to run al Algorithm that buys and sells put options on SPY based on some signals on the stock itself.
I have a csv file with the time series containing price, strike price, date and expiry for all available put options on SPY between 2012 - 2013.
I am calling this file to the algo with the Fetcher, however each option has an ID, which cannot be mapped as a sid(), and therefore they are not recognised as tradable securities.

I have read some entries in the forum with different solutions, but I haven't found a way to make Quantopian to recognise the put options as individual securities without mapping them into sid(). All I have found in the Fetcher help is to upload the file either with a symbol column, which again will be mapped to valid securities (Sid), or to upload the file as a signal to trigger transactions on stocks. But as you can tell, the file is none of the above.

Another way I found is to define the universe by fetching another CSV with the option data. This however works in the same way, by mapping the security into a sid(). So it did not work either. I've been reading about it but I am kind of stuck. Do you maybe have an advice on how to approach this issue, namely, how to set the Option ID into a tradable security that I can programme to buy and sell according to pre-defined signals?

The URL for the file I am currently using is:
https://dl.dropboxusercontent.com/s/ukulrncgnhif3ue/SPY.csv?dl=0

I attach the algorithm as well, which is not yet finished as I am currently trying to set the options as tradable securities.

Thank you all in advance.

Cheers

Seb

1 response

after messing around with it the logs say
1969-12-31 18:00 WARN Dropped 328 rows from fetched csv.
2013-01-02 07:45 WARN :80: FutureWarning: pd.rolling_mean is deprecated for Series and will be removed in a future version, replace with
Series.rolling(window=12,center=False).mean()
2013-01-02 07:45 WARN :81: FutureWarning: pd.rolling_mean is deprecated for Series and will be removed in a future version, replace with
Series.rolling(window=26,center=False).mean()
2013-01-02 07:45 WARN :83: FutureWarning: pd.rolling_mean is deprecated for Series and will be removed in a future version, replace with
Series.rolling(window=9,center=False).mean()

so you'll have to make it pull live data somehow. I really would like options algorithms but it seems the powers that be
1)don't like the idea although they are into futures
2)the backoffice programming is so cumbersome as near prohibitive.
3) only one or two admins have the knowledge to set up options data for algos and they don't think they should put Quantopian time into it right now.
This is pretty advanced trading tactics and for them to just ignore your post smacks of something unkind