Overall Statistics
Total Trades
1831
Average Win
0.76%
Average Loss
-0.65%
Compounding Annual Return
-29.606%
Drawdown
88.800%
Expectancy
-0.263
Net Profit
-82.764%
Sharpe Ratio
-0.782
Probabilistic Sharpe Ratio
0.000%
Loss Rate
66%
Win Rate
34%
Profit-Loss Ratio
1.17
Alpha
-0.197
Beta
-0.137
Annual Standard Deviation
0.278
Annual Variance
0.077
Information Ratio
-1.094
Tracking Error
0.337
Treynor Ratio
1.582
Total Fees
$0.00
Estimated Strategy Capacity
$1300000.00
Lowest Capacity Asset
AUDJPY 5O
class BootCampTask(QCAlgorithm):
    
    def Initialize(self):
        self.SetStartDate(2016, 6, 1)
        self.SetEndDate(2021, 6, 1)
        self.SetCash(100000)
        
        self.period = 125
        self.totalPairsToHold = 6
        self.indicators = {}
        self.leverage = 5.0
        
        self.tickers = ["USDCAD","EURJPY","EURUSD","EURCHF","USDCHF","EURGBP",
                        "GBPUSD","AUDCAD","NZDUSD","GBPCHF","AUDUSD","GBPJPY",
                        "USDJPY","CHFJPY","EURCAD","AUDJPY","EURAUD","AUDNZD"]
        
        #self.SetBrokerageModel(BrokerageName.FxcmBrokerage)
        for ticker in self.tickers:
            self.AddForex(ticker, Resolution.Daily, Market.FXCM);
            self.indicators[ticker] = self.MOMP(ticker, self.period, Resolution.Daily);
            self.Securities[ticker].FeeModel = ConstantFeeModel(0)
            
        self.SetWarmup(self.period)

    def OnData(self, data):
        if self.IsWarmingUp:
            return
        
        gainers = pd.Series(self.indicators).sort_values(ascending = False)[:int(self.totalPairsToHold / 2)].keys()
        losers = pd.Series(self.indicators).sort_values(ascending = True)[:int(self.totalPairsToHold / 2)].keys()
        
        for ticker in self.indicators.keys():
            if (ticker in gainers) == False and (ticker in losers) == False:
                if self.Portfolio[ticker].Invested:
                    self.Liquidate(ticker)
                
        for ticker in gainers:
            if self.Portfolio[ticker].Invested == False:
                self.SetHoldings(ticker, self.leverage / self.totalPairsToHold)
                
        for ticker in losers:
            if self.Portfolio[ticker].Invested == False:
                self.SetHoldings(ticker, -self.leverage / self.totalPairsToHold)