Overall Statistics
Total Trades
95
Average Win
10.34%
Average Loss
-1.40%
Compounding Annual Return
10.757%
Drawdown
17.300%
Expectancy
1.857
Net Profit
177.932%
Sharpe Ratio
0.872
Loss Rate
66%
Win Rate
34%
Profit-Loss Ratio
7.39
Alpha
0.042
Beta
3.399
Annual Standard Deviation
0.127
Annual Variance
0.016
Information Ratio
0.714
Tracking Error
0.127
Treynor Ratio
0.032
Total Fees
$701.89
class ResistanceNadionCoreWave(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2009,1,1)  # Set Start Date
        self.SetEndDate(2018,12,31)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        self.SetBenchmark('SPY')
        self.SetWarmUp(200)
        
        self.risk_on = 'SPY'
        self.risk_off = 'IEF'
        all_eq = [self.risk_on,self.risk_off]
        for eq in all_eq:
            self.AddEquity(eq,Resolution.Hour)
        
        self.risk_sma = self.SMA(self.risk_on,200,Resolution.Daily)

    def OnData(self, data):
        # Trade at specific time
        if self.Time.hour==10 and self.Time.minute==0:
            if self.Securities[self.risk_on].Price>self.risk_sma.Current.Value:
                self.Liquidate(self.risk_off)
                self.SetHoldings(self.risk_on,1)
            else:
                self.Liquidate(self.risk_on)
                self.SetHoldings(self.risk_off,1)