Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0
Probabilistic Sharpe Ratio
0%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
-0.996
Tracking Error
0.197
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
class ContinuousFutureRegressionAlgorithm(QCAlgorithm):
    def Initialize(self):
        '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''
        self.SetCash(1000000)
        self.SetStartDate(2019, 1, 1)
        self.SetEndDate(2021, 6, 1)

        self._lastDateLog = -1
        self._continuousContract = self.AddFuture(Futures.Energies.CrudeOilWTI,
                                                  dataNormalizationMode = DataNormalizationMode.BackwardsRatio,
                                                  dataMappingMode = DataMappingMode.OpenInterest,
                                                  contractDepthOffset = 0)
        self.slow_sma = self.SMA(self._continuousContract.Symbol, 50, Resolution.Hour)
        self.fast_sma = self.SMA(self._continuousContract.Symbol, 200, Resolution.Hour)
        self.Schedule.On(self.DateRules.EveryDay(), self.TimeRules.Midnight, self.PlotPrices);

    def PlotPrices(self):
        if self._continuousContract.HasData:
            self.Plot(self._continuousContract.Symbol.ID.Symbol, self._continuousContract.Symbol.ID.Symbol, self._continuousContract.Price)
            self.Plot(self._continuousContract.Symbol.ID.Symbol, "Slow", self.slow_sma.Current.Value)
            self.Plot(self._continuousContract.Symbol.ID.Symbol, "Fast", self.fast_sma.Current.Value)