Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Andy Brim USUInvests MVA Daily Strategy

This Algo shows how to run a daily strategy in quantopian.com handle_data runs every minute, but we only want this strategy to buy/sell at daily intervals.

5 responses

Carefully analyzing "Andy Brim USUInvests MVA Daily Strategy" I came to conclusion that it is just "Buy and Hold" with dividends reinvestment very similar to these 4 lines algo :

def initialize(context):  
    schedule_function(trade, date_rules.month_start(6), time_rules.market_open(hours = 1))  
def trade(context, data):  
    order_target_percent(symbol('msft'),1.0)  

From 2016-10-10 to 2017-10-09 with $1,000 initial capital

Total Returns
34.17%
Benchmark Returns
20.47%
Alpha
0.09
Beta
1.14
Sharpe
2.16
Sortino
3.59
Volatility
0.14
Max Drawdown
-5.33%

Thanks for the feedback!

You're close- it buy and holds as long as current price is above 5 day moving average. I'm surprised the returns are actually that close to buy/hold outright returns.

Andrew,

"Andy Brim USUInvests MVA Daily Strategy" code dose not generate any "Sell" or "Short" orders .
There is only 1 "Buy" transaction in Transactions Details.

You're right, it only sells if you own it and current price goes below 5day mavg. Thanks Vladimir!

Andrew,

"Andy Brim USUInvests MVA Daily Strategy" code dose not sells stock if you own it and current price goes below 5day mavg. There is only 1 "Buy" transaction in Transactions Details.