Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
15.439%
Drawdown
2.000%
Expectancy
0
Net Profit
4.096%
Sharpe Ratio
1.951
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.001
Beta
0.993
Annual Standard Deviation
0.059
Annual Variance
0.003
Information Ratio
-0.488
Tracking Error
0.004
Treynor Ratio
0.116
Total Fees
$2.03
class BasicTemplateAlgorithm(QCAlgorithm):
    def Initialize(self):
        self.SetStartDate(2017,8,6)
        self.AddEquity("SPY", Resolution.Daily)
        
        adx = AverageDirectionalIndex("", 14)
        
        bars = self.History("SPY", 30, Resolution.Daily)
        for bar in bars:
            adx.Update(bar)
        
        self.Debug("Is ADX ready? {}. Value: {}".format(adx.IsReady, adx))

    def OnData(self, data):
        if not self.Portfolio.Invested:
            self.SetHoldings("SPY", 1)