Back to Community
QUANTOPIAN SPEAKERS ONLY

hi

Clone Algorithm
3
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
# -------------------------------------------------------------------------------------------------  
assets = symbols('VCLT','VHT','SGOL','FREL','BNDX','SPY','PCY','EWJ','EWD'); 
wt = [0.1287,0.02,0.1379,0.005,0.1523,0.4611,0.005,0.045,0.045]; 
M = [1]  
# -------------------------------------------------------------------------------------------------  
def initialize(context):  
     schedule_function(trade, date_rules.month_start(), time_rules.market_open(minutes = 65), True)  
     context.invested = False  

def trade(context,data):  
    if get_open_orders() or (context.invested and get_datetime().month not in M): return

    for i in range(len(assets)):  
        if data.can_trade(assets[i]):  
            order_target_percent(assets[i], wt[i])  
            context.invested = True
There was a runtime error.
1 response