GithubHelp home page GithubHelp logo

sovannit / optopsy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michaelchu/optopsy

0.0 1.0 0.0 49 KB

An event driven backtesting and option chain analysis Python library.

License: MIT License

Python 100.00%

optopsy's Introduction

Optopsy

This library allows you to backtest options strategies with your own historical options data. Use the built-in functions to generate options spreads with adjustable parameters and backtest them with your own custom entry / exit / adjustment criteria.

Goals

This project was developed because I was learning to trade options and had a need for a simple and flexible trading library that will allow me to backtest my option trading strategies. At the time of its development, it was difficult to find options backtesting software/libraries that allows the flexibility of testing options spreads with complex entry, exit or adjustment criteria. I wrote this library to meet that need and I hope it will help you too!

Features

  • Uses Pandas library under the hood to generate options spreads efficiently.
  • Option spreads can be generated with adjustable parameters such as strike width and expiration dates. This allows you to create more advance strategies such as broken-wing butterflies/iron condors
  • Generates historical option spread prices for all possible strike combinations from the option chain.
  • Use your own options data source by using the built-in data adapters or write your own. (Currently supports sqlite)
  • Integrated brokerage simulation with market and limit orders
  • Interchangeable and extensible position sizers, slippage and commissions modules (WIP)
  • Optimization support: define a range for your strategy parameters and the system will execute the strategy for each value of the range
  • The following options strategies are currently supported:
    • Single Calls/Puts
    • Vertical Spreads

Planned Features

  • CSV file support
  • Option strategy support:
    • Iron Condors (Iron Butterflies)
    • Covered Stock
    • Combos (Synthetics/Collars)
    • Diagonal Spreads
    • Calendar Spreads
    • Custom Spreads
    • Strangles
    • Straddles
  • Transaction Costs - Commissions are currently supported using TD's thinkorswim standard fees for North American options. Slippage and market impact are planned, but are not currently supported.

optopsy's People

Contributors

michaelchu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.