Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
MONTHLY AGGREGATION PERIOD

Hello,

I have an amazing strategy I cannot seem to implement because it requires the use of a monthly aggregation period, not daily or minutes. Its the most important aspect to the strategy. Is there a way to implement this?

Thank you,
Dante Migale

4 responses

Nobody? :c

Try something like this:

 period=3 # in month  
 daily_prices = data.history(stock, 'price', period*21, '1d')  
 monthly_prices = daily_prices.resample('1M', how='last', closed='left', label='left')  

Thank you Vladimir! I will try this!

That seemed to work!