Overall Statistics
Total Trades
128
Average Win
2.83%
Average Loss
-3.66%
Compounding Annual Return
22.557%
Drawdown
43.600%
Expectancy
0.243
Net Profit
176.795%
Sharpe Ratio
0.908
Probabilistic Sharpe Ratio
33.001%
Loss Rate
30%
Win Rate
70%
Profit-Loss Ratio
0.77
Alpha
0.204
Beta
-0.01
Annual Standard Deviation
0.223
Annual Variance
0.05
Information Ratio
0.18
Tracking Error
0.281
Treynor Ratio
-20.673
Total Fees
$0.00
Estimated Strategy Capacity
$660000.00
Lowest Capacity Asset
EURUSD 8G
class BootCampTask(QCAlgorithm):
    
    def Initialize(self):
        self.SetStartDate(2016, 6, 1)
        self.SetEndDate(2021, 6, 1)
        self.SetCash(10000)
        
        self.AddForex("EURUSD", Resolution.Hour)
        self.stochastic = self.STO("EURUSD", 240, Resolution.Hour)
        self.SetWarmup(240)

    def OnData(self, data):
        if self.IsWarmingUp:
            return
        if self.stochastic.IsReady == False:
            return
        
        if self.stochastic.Current.Value < 20:
            if self.Portfolio["EURUSD"].Invested == False:
                self.MarketOrder("EURUSD", 50000)
            elif self.Portfolio["EURUSD"].IsShort:
                self.MarketOrder("EURUSD", 100000);
        elif self.stochastic.Current.Value > 80:
            if self.Portfolio["EURUSD"].Invested == False:
                self.MarketOrder("EURUSD", -50000)
            elif self.Portfolio["EURUSD"].IsLong:
                self.MarketOrder("EURUSD", -100000);
                
    def OnOrderEvent(self, orderEvent):
        if orderEvent.Status == OrderStatus.Filled:
            self.Debug("Euros=" + str(self.Portfolio.CashBook["EUR"].Amount))
            self.Debug("Dollars=" + str(self.Portfolio.CashBook["USD"].Amount))