Giter VIP home page Giter VIP logo

optopsy's Introduction

Downloads Build Status Black

Optopsy

Optopsy is a nimble backtesting libary for option strategies, it is designed to act as an API for your option chain datasets and allows you to focus on what matters, your trading strategy.

The library is designed to compose well into your data analysis work and uses Pandas extensively under the hood. It extends PandasObject to faciliate common functional composition used in quant finance. As such, please note that importing optopsy modifies pandas.core.base.PandasObject to provide added functionality to pandas objects, including DataFrames.

This library is currently in development, please use at your own risk

Usage

Use Your Data

  • Use data from any source, just provide a Pandas dataframe with the required columns when calling optopsy functions.

Advanced Backtest Parameters:

  • Optopsy allows you to mix and match different 'filters' to create an option strategy. Results will be returned as Pandas dataframes so that complex strategies can be composed upon. It is highly encourage to make use of pandas.DataFrame.pipe functions and chain methods wherever possible make your code cleaner. To learn more about the subject, I highly recommend reading the following blog post.

Entry rules:

  • Days to expiration
  • Entry Days (Staggered trades)
  • Absolute Delta
  • Percentage out-of-the-money
  • Contract size

Exit rules:

  • Days to expiration
  • Hold days
  • Profit/Stop loss percent
  • Spread delta
  • Spread price

Option strategy support

  • Single Calls/Puts
  • Vertical Spreads
  • Iron Condors
  • (Coming Soon) Iron Butterfly
  • (Coming Soon) Covered Stock
  • (Coming Soon) Combos (Synthetics/Collars)
  • (Coming Soon) Diagonal Spreads
  • (Coming Soon) Calendar Spreads
  • (Coming Soon) Custom Spreads
  • (Coming Soon) Strangles
  • (Coming Soon) Straddles

Dependencies

You will need Python 3.7.x and Pandas 0.24.1 or newer. It is recommended to install Miniconda3. See requirements.txt for full details.

Installation

pip install optopsy

Usage

Optopsy is best used with Jupyter notebooks, however, it is also possible to incorporate it into your python scripts:

The following example uses Level 2 Historical CSV Data Sample from historicaloptiondata.com.

Full Documentation Coming Soon!

optopsy's People

Contributors

michaelchu avatar moue avatar codacy-badger 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.