Reverse engineered prompt

Build me a Python library for researching and backtesting options strategies. I want to be able to load options chain data from a CSV, or download and cache historical data locally, then quickly test ideas like a 45 DTE iron condor with a profit target, stop loss, or hold to expiration.

Please include a simple API for common strategies like long and short calls and puts, spreads, straddles, strangles, butterflies, iron condors, calendars, diagonals, collars, and covered style trades. I also want a fuller simulator that tracks capital, position sizing, max open trades, trade logs, equity curve, commissions, slippage, and early exits. It should support portfolio backtests across multiple strategies too.

Make the results easy to inspect with summary stats, grouped performance by DTE and delta, plus risk metrics like drawdown and Sharpe style numbers. It would be great to filter entries with built in technical signals or a custom boolean signal from a dataframe.

Please include examples, tests, and clean docs. Look up current docs online if you need to.

Want more depth? Deep Reverse