Overall Statistics
Total Orders
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
-30.235%
Drawdown
14.200%
Expectancy
0
Start Equity
100000
End Equity
96920.7
Net Profit
-3.079%
Sharpe Ratio
-0.881
Sortino Ratio
-1.447
Probabilistic Sharpe Ratio
27.075%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0.063
Beta
2.285
Annual Standard Deviation
0.283
Annual Variance
0.08
Information Ratio
-0.683
Tracking Error
0.165
Treynor Ratio
-0.109
Total Fees
$2.15
Estimated Strategy Capacity
$78000000.00
Lowest Capacity Asset
ES YGT6HGVF2SQP
Portfolio Turnover
6.79%
# region imports
from AlgorithmImports import *
# endregion

class SleepyTanAlligator(QCAlgorithm):

    def initialize(self):
        self.set_start_date(2023, 10, 1)
        self.set_end_date(2023, 11, 1)
        self.set_cash(100000)
        self.future = self.add_future(Futures.Indices.SP_500_E_MINI)
        self.symbol = self.future.symbol
        self.future.set_filter(0, 182)

    def on_data(self, data: Slice):
        if not self.portfolio.invested:
            for continuous_contract_symbol, chain in data.futures_chains.items():
                contract = sorted(chain, key=lambda contract: contract.open_interest, reverse=True)[0]
                self.market_order(contract.symbol, 1)

    def on_end_of_day(self, symbol) -> None:
        self.plot("Margin", "MarginRemaining", self.portfolio.margin_remaining)
        self.plot("Margin", "TotalMarginUsed", self.portfolio.total_margin_used)