Back to Community
Dynamic TSPP list

- Addded code that looks at 'Tick_Size_Pilot_Program_Group' column and removes the control group which isn't affected by price restrictions
- Added code that includes details on how to buy/sell in .05 increments if needed.
- Cleaned up code and removed unnessesary lines
- Now works in live trading and backtests

If you already use fetcher in your algorithm:

line 8: #del df['Tick_Size_Pilot_Program_Group']  
line 32: context.TSPP = [x for x in data.fetcher_assets if data.current(data.fetcher_assets,'Tick_Size_Pilot_Program_Group')[x]] #untested but should work because only TSPP fetched assets will have this data. Slows down execution signifigantly.  
Clone Algorithm
Backtest from to with initial capital
Total Returns
Max Drawdown
Benchmark Returns
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 5898bb4389fd175e36f814e1
There was a runtime error.
7 responses

What a great idea Luke Izlar.


Apparently this code does not work in live trading, but it works in backtest. Anyone have any ideas?

It was a forward fill issue with live trading (thanks quantopian support!), it should be working now in both backtesting and live trading.

Implementing this dynamic TSPP 5-cent securities list by Luke tomorrow, great work he did folks, making for no more worries about that.


That link works for me, but I did have to remove this code from my live algorithms. Until Quantopian improves the reliability of their fetch CSV I don't recommend using it. My algorithm would randomly fail to download the data about twice a week. This shouldn't cause a fatal error but it does and you lose all your algorithm variables when you have to restart.

It might be the fault of the source but really it should be more robust such that a small hiccup crashes your algorithm.