Back to Community
backtest of spy from 2002-2018

return of 118%

Clone Algorithm
1
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
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
from quantopian.algorithm import calendars

# Called once at the start of the simulation.
def initialize(context):
    # Reference to the AAPL security.
    context.spy = sid(8554)
    context.start = True
    schedule_function(market_open, date_rules.every_day(), time_rules.market_open(), calendar=calendars.US_EQUITIES)  
    
def market_open(context, data):
    # Put all my money in SPY.
    if context.start == True:
        order_target_percent(context.spy,1.0)
        context.start = False

 

There was a runtime error.