Overall Statistics
Total Trades
4
Average Win
0%
Average Loss
-12.41%
Compounding Annual Return
-9.787%
Drawdown
58.500%
Expectancy
-1
Net Profit
-37.129%
Sharpe Ratio
-0.175
Probabilistic Sharpe Ratio
0.622%
Loss Rate
100%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.065
Beta
0.1
Annual Standard Deviation
0.295
Annual Variance
0.087
Information Ratio
-0.537
Tracking Error
0.342
Treynor Ratio
-0.516
Total Fees
$311.09
class ParticleMultidimensionalCompensator(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2015, 12, 29)
        self.SetCash(100000)
        
        symbols = [ Symbol.Create("DAG", SecurityType.Equity, Market.USA) ]
        self.SetUniverseSelection( ManualUniverseSelectionModel(symbols) )
        
        self.AddAlpha(MyAlphaModel(symbols[0]))
        
        self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel())
        
        self.SetExecution(ImmediateExecutionModel())


class MyAlphaModel(AlphaModel):
    def __init__(self, symbol):
        self.symbol = symbol
        self.security = None
    
    def Update(self, algorithm, slice):
        if algorithm.Securities.ContainsKey("DAG"):
            self.security = algorithm.Securities["DAG"]
        
        if algorithm.Portfolio.Invested or \
            not slice.ContainsKey("DAG") or \
            not algorithm.Securities.ContainsKey("DAG") or \
            not self.security.IsTradable: 
            return []
            
        return [Insight.Price("DAG", timedelta(days=9999), InsightDirection.Up)]
    
    def OnSecuritiesChanged(self, algorithm, changes):
        pass