### Example Iron Condor Configuration (TOML) Source: https://github.com/ishapiro/lumibot_backtesting_machine/blob/main/README.md This snippet presents example configuration parameters for the Iron Condor backtesting strategy, typically stored in a TOML file. It defines crucial settings like the trading symbol, option duration, strike spacing, required delta for entry and rolling, trade size, holding periods, wing distance, rolling strategy, and backtesting date range. ```TOML symbol = "SPY" option_duration = 40 # How many days until the call option expires when we sell it strike_step_size = 1 # IMS Is this the strike spacing of the specific asset can we get this from Poloygon? delta_required = 0.16 # The delta of the option we want to sell roll_delta_required = 0.16 # The delta of the option we want to sell when we do a roll maximum_rolls = 2 # The maximum number of rolls we will do days_before_expiry_to_buy_back = 7 # How many days before expiry to buy back the call quantity_to_trade = 10 # The number of contracts to trade minimum_hold_period = 5 # The of number days to wait before exiting a strategy -- this strategy only trades once a day distance_of_wings = 15 # Distance of the longs from the shorts in dollars -- the wings strike_roll_distance = 5 # How close to the short do we allow the price to move before rolling. trading_fee = 0.60 # Commmision and slipage max_loss_multiplier = 2.0 # The maximum loss as a multiple of initial credit, set to 0 to disable maximum_portfolio_allocation = 0.75 # The maximum amount of the portfolio to allocate to this strategy for new condors max_loss_trade_days_to_skip = 3 # The number of days to skip after a max loss trade roll_strategy = "short" # short, delta, none # IMS not fully implemented delta_threshold = 0.20 # The delta threshold for rolling starting_date = 2020-02-01 ending_date = 2020-04-30 ``` -------------------------------- ### Configuring Polygon API Key (Python) Source: https://github.com/ishapiro/lumibot_backtesting_machine/blob/main/README.md This snippet shows the Python dictionary structure for storing the Polygon API key in a `credentials.py` file. This file is essential for the Lumibot strategy to fetch necessary market data and must be located at the same directory level as the strategy file. ```Python POLYGON_CONFIG = { # Put your own Polygon key here: "API_KEY": "hjkhkjhjkhkjhkjhkjhkjhhk", } ``` -------------------------------- ### Enabling Local Lumibot Import (Python) Source: https://github.com/ishapiro/lumibot_backtesting_machine/blob/main/README.md This Python code, placed at the top of the strategy file, facilitates development by conditionally adding a local Lumibot directory to `sys.path`. When `use_local_lumibot` is True, it ensures the strategy imports the Lumibot module from the specified local path rather than a pip-installed version, allowing local modifications to the framework. ```Python use_local_lumibot = True # Must Be Imported First If Run Locally if use_local_lumibot: import os import sys myPath = os.path.dirname(os.path.abspath(__file__)) myPath = myPath.replace("iron_condor_lumibot_example", "") myPath = myPath + "/lumibot/" sys.path.insert(0, myPath) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.