| Overall Statistics |
|
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 0% Drawdown 102.100% Expectancy 0 Net Profit -114.247% Sharpe Ratio 369.535 Probabilistic Sharpe Ratio 51.278% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 2558.096 Beta 22.038 Annual Standard Deviation 6.923 Annual Variance 47.926 Information Ratio 376.958 Tracking Error 6.786 Treynor Ratio 116.083 Total Fees $123.50 Estimated Strategy Capacity $60000000.00 Lowest Capacity Asset CL Y0AGGZXGV2KH |
# region imports
from AlgorithmImports import *
# endregion
class MuscularFluorescentOrangeGorilla(QCAlgorithm):
def Initialize(self):
# Set Start Date
self.SetStartDate(2022, 6, 22)
# Set Strategy Cash
self.SetCash(100000)
self.SetSecurityInitializer(self.CustomSecurityInitializer)
# Add future
future = self.AddFuture(Futures.Energies.CrudeOilWTI)
future.SetFilter(0, 180)
self.future_symbol = future.Symbol
def CustomSecurityInitializer(self, security):
if security.Type == SecurityType.Future:
security.MarginModel = MyBuyingPowerModel() # your custom model
def OnData(self, data: Slice):
# If not invested
if not self.Portfolio.Invested:
# Buy
chain = data.FuturesChains.get(self.future_symbol)
if chain:
for contract in chain:
self.MarketOrder(contract.Symbol, 50)
break
class MyBuyingPowerModel(BuyingPowerModel):
def __init__(self,
leverage = 100):
super().__init__(leverage)
def SetLeverage(self, security: Security, leverage: float) -> None:
super().SetLeverage(security, leverage)