Overall Statistics
Total Orders
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Start Equity
100000
End Equity
100000
Net Profit
0%
Sharpe Ratio
0
Sortino 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.57
Tracking Error
0.11
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
Portfolio Turnover
0%
# region imports
from AlgorithmImports import *
from QuantConnect.DataSource import *
# endregion

class FuturesPractice4(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2014, 4, 1)
        self.SetEndDate(2019, 1, 1)
        self.SetCash(100000)
        self._future = self.add_future(Futures.Grains.SOYBEAN_MEAL, Resolution.Daily)
        self._symbol = self._future.symbol
        self.UniverseSettings.DataMappingMode = DataMappingMode.OPEN_INTEREST

    
    
    def on_data(self, slice: Slice) -> None:
        if slice[self._symbol]:
            if slice[self._symbol].IsFillForward:
                self.Log(f"Fill Forward price")
            #self.Log(f"Price: {slice[self._symbol].Close}")
        for symbol, changed_event in  slice.symbol_changed_events.items():
            old_symbol = changed_event.old_symbol
            new_symbol = changed_event.new_symbol
            self.log(f"Rollover - Symbol changed at {self.time}: {old_symbol} -> {new_symbol}")