Overall Statistics
Total Trades
127
Average Win
0.84%
Average Loss
-1.17%
Compounding Annual Return
5.667%
Drawdown
13.000%
Expectancy
0.196
Net Profit
31.769%
Sharpe Ratio
0.755
Probabilistic Sharpe Ratio
25.584%
Loss Rate
30%
Win Rate
70%
Profit-Loss Ratio
0.71
Alpha
0.047
Beta
0.003
Annual Standard Deviation
0.063
Annual Variance
0.004
Information Ratio
-0.6
Tracking Error
0.18
Treynor Ratio
14.051
Total Fees
$0.00
Estimated Strategy Capacity
$1500000.00
Lowest Capacity Asset
EURUSD 8G
class BootCampTask(QCAlgorithm):
    
    def Initialize(self):
        self.SetStartDate(2016, 6, 13)
        self.SetEndDate(2021, 6, 13)
        self.SetCash(100000)
        
        self.symbol = self.AddForex("EURUSD", Resolution.Hour).Symbol
        self.stochastic = self.STO("EURUSD", 240, Resolution.Hour)
        self.SetWarmup(240)

    def OnData(self, data):
        if self.IsWarmingUp:
            return
        
        if self.Portfolio["EURUSD"].Quantity <= 0 and self.stochastic.Current.Value < 20:
            self.SetHoldings("EURUSD", 1)
        elif self.Portfolio["EURUSD"].Quantity >= 0 and self.stochastic.Current.Value > 80:
            self.SetHoldings("EURUSD", -1)