Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
-4.000%
Drawdown
8.800%
Expectancy
0
Net Profit
-1.664%
Sharpe Ratio
-0.248
Probabilistic Sharpe Ratio
18.641%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.036
Beta
0.039
Annual Standard Deviation
0.09
Annual Variance
0.008
Information Ratio
-2.134
Tracking Error
0.184
Treynor Ratio
-0.578
Total Fees
$0.00
Estimated Strategy Capacity
$3100000.00
class DeterminedYellowGreenBull(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 6, 19)
        self.SetEndDate(2020, 11, 15)
        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 not self.Portfolio.Invested:
            if self.atr.Current.Value > self.sma_atr.Current.Value:
                if self.alma_fast.Current.Value > self.alma_slow.Current.Value:
                    if self.py.Close > self.alma_slow.Current.Value:
                        self.SetHoldings("AUDNZD", 2)
                    
                    
                
        if not self.Portfolio.Invested:
            if self.atr.Current.Value > self.sma_atr.Current.Value:
                if self.alma_fast.Current.Value < self.alma_slow.Current.Value:
                    if self.py.Close < self.alma_slow.Current.Value:
                        self.SetHoldings("AUDNZD", -2)
                        
        if self.Portfolio.Invested:
            if self.Securities["AUDNZD"].Price == self.baseline.Current.Value:
                self.Liquidate()