Overall Statistics
Total Trades
136
Average Win
1.33%
Average Loss
-1.26%
Compounding Annual Return
5.168%
Drawdown
11.400%
Expectancy
0.286
Net Profit
28.736%
Sharpe Ratio
0.96
Probabilistic Sharpe Ratio
44.408%
Loss Rate
37%
Win Rate
63%
Profit-Loss Ratio
1.05
Alpha
0.022
Beta
0.222
Annual Standard Deviation
0.056
Annual Variance
0.003
Information Ratio
-0.582
Tracking Error
0.154
Treynor Ratio
0.24
Total Fees
$136.00
class ParticleHorizontalPrism(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2015, 8, 18)  # Set Start Date
        self.SetCash(30000)  # Set Strategy Cash
        self.AddEquity("VOO", Resolution.Minute)
        self.AddEquity("BOND", Resolution.Minute)
        self.AddEquity("GLD", Resolution.Minute)
        self.AddEquity("SCHA", Resolution.Minute)
        self.AddEquity("MINT", Resolution.Minute)
        self.tickers = ["VOO", "BOND", "MINT", "GLD", "SCHA"]
        '''
        Golden Butterfly fixed portfolio:
            20% Total Stock Market
            20% Small Cap Value
            20% Long Term Bonds
            20% Short Term Bonds
            20% Gold
        '''
        
        self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel())
        
        self.lastmonth = -1
        
    def OnData(self, data):
        
        month = self.Time.month
        if month == self.lastmonth:
            return
        self.lastmonth = month
        
        #Golden Butterfly
        for symbol in self.tickers:
            if not self.Portfolio[symbol].Invested:
                self.SetHoldings(symbol, 0.2)
                
            if self.Securities[symbol].Invested and (self.Securities[symbol].Holdings.UnrealizedProfitPercent>0.04 or self.Securities[symbol].Holdings.UnrealizedProfitPercent<-0.02):
                self.Liquidate(symbol)