Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Restrict sold securities for 3 Days before buying again

I need to have a dictionary with the securities sold and automatically restricting them for 3 day so I don't buy the same and break rules...

Any help would be great.

how to add to this list from the function where i sell. does this needs to be in initialize?

historical_restrictions = HistoricalRestrictions([
Restriction(symbol(stock), pd.Timestamp('2011-01-06 10:00', tz='US/Eastern'), states.FROZEN),
Restriction(symbol(stock), pd.Timestamp('2011-01-06', tz='US/Eastern'), states.FROZEN),
])

set_asset_restrictions(historical_restrictions)