Overall Statistics
Total Trades
230
Average Win
0.20%
Average Loss
-0.09%
Compounding Annual Return
-90.633%
Drawdown
8.400%
Expectancy
-0.830
Net Profit
-8.088%
Sharpe Ratio
-6.679
Probabilistic Sharpe Ratio
0.516%
Loss Rate
95%
Win Rate
5%
Profit-Loss Ratio
2.26
Alpha
-0.814
Beta
-0.231
Annual Standard Deviation
0.128
Annual Variance
0.016
Information Ratio
-3.561
Tracking Error
0.289
Treynor Ratio
3.703
Total Fees
$0.00
Estimated Strategy Capacity
$1200000.00
class DeterminedYellowGreenBull(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 6, 19)
        self.SetEndDate(2020, 7, 1)
        self.SetCash(100000)
        self.py = self.AddForex("AUDNZD", Resolution.Minute)
        self.SetWarmup(600)
        
        self.alma_fast = self.ALMA("AUDNZD", 240, Resolution.Minute)
        self.alma_slow = self.ALMA("AUDNZD", 350, Resolution.Minute)
        self.baseline = self.EMA("AUDNZD", 598, Resolution.Minute)

        self.atr = self.ATR("AUDNZD", 14, MovingAverageType.Simple, Resolution.Minute)
        self.sma_atr = IndicatorExtensions.Of(SimpleMovingAverage(10), self.atr)
        
    def OnData(self, data):
        
        if not self.baseline.IsReady:
            return
        
        self.Plot("Custom", "alma_fast", self.alma_fast.Current.Value)
        self.Plot("Custom", "alma_slow", self.alma_slow.Current.Value)
        
        
        if self.Securities["AUDNZD"].Price <= self.baseline.Current.Value:
            if self.Portfolio.Invested:
                self.Liquidate()
            return
        
        if not self.Portfolio.Invested:
            if self.alma_fast.Current.Value > self.alma_slow.Current.Value and self.py.Close > self.alma_slow.Current.Value:
                self.SetHoldings("AUDNZD", 2)
                
            elif self.alma_fast.Current.Value < self.alma_slow.Current.Value and self.py.Close < self.alma_slow.Current.Value:
                self.SetHoldings("AUDNZD", -2)