| Overall Statistics |
|
Total Trades 20 Average Win 2.52% Average Loss -3.19% Compounding Annual Return 3.895% Drawdown 4.400% Expectancy 0.612 Net Profit 21.075% Sharpe Ratio 1.002 Probabilistic Sharpe Ratio 48.308% Loss Rate 10% Win Rate 90% Profit-Loss Ratio 0.79 Alpha 0.03 Beta 0.068 Annual Standard Deviation 0.04 Annual Variance 0.002 Information Ratio -0.561 Tracking Error 0.184 Treynor Ratio 0.592 Total Fees $20.30 |
class ParticleHorizontalPrism(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2015, 8, 18) # Set Start Date
self.SetCash(30000) # Set Strategy Cash
self.AddEquity("SPY", Resolution.Minute)
self.AddEquity("BOND", Resolution.Minute)
self.AddEquity("SRVR", Resolution.Minute)
self.tickers = ["SPY", "BOND", "SRVR"]
'''
Golden Butterfly fixed portfolio:
40% domestic stocks
40% bonds
20% real assets
'''
self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel())
self.lastmonth = -1
def OnData(self, data):
month = self.Time.month
if month == self.lastmonth:
return
self.lastmonth = month
if not self.Portfolio.Invested:
self.SetHoldings("SPY", 0.4)
self.SetHoldings("BOND", 0.4)
self.SetHoldings("SRVR", 0.2)
for symbol in self.tickers:
if self.Securities[symbol].Invested and (self.Securities[symbol].Holdings.UnrealizedProfitPercent>0.05 or self.Securities[symbol].Holdings.UnrealizedProfitPercent<-0.03):
self.Liquidate(symbol)