Giter VIP home page Giter VIP logo

optopsy's Introduction

Development Update (June 1, 2018)

Codacy Badge Build Status codecov

This library is currently being redeveloped to be better optimized for options backtesting.

The new version will provide predefined filters to act as building blocks for your option trading strategies. No need to extend classes to implement custom trade configurations such as position sizing and commissions. These settings can now be defined using existing filters.

Filters will include (but not limited to):

Entry rules:

  • Days to expiration
  • Entry Days (Stagger 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

Development changes will be made on the development branch. The backtester branch will be retained for historical purposes and will be removed at a later time.

Optopsy

Optopsy is a flexible backtesting framework used to test complex options trading strategies written in Python. Backtesting is the process of testing a strategy over a given data set. This framework allows you to mix and match different 'filters' to create a 'Strategy', and allow multiple strategies to form an overall more complex trading algorithms. The modular nature of this framework aims to foster the creation of easily testable, re-usable and flexible blocks of strategy logic to facilitate the rapid development of complex options trading strategies.

Features

  • Open source - Feel free to make requests or contribute to the code base! Help out a fellow trader!
  • BYOD - "Bring your own Data" source by using the built-in data adapters or write your own. (Currently supports csv files)
  • Modular Design - Facilitates the construction and composition of complex algorithmic trading strategies that are modular and re-usable.
  • Optimization support - Define ranges for your strategy parameters and the system will optimize the strategy

Planned Features

  • Indicator Support - Create entry and exit rules based on indicators
  • Optimizer - Allows users to run multiple backtests with different combinations of parameters
  • Option strategy support:
    • Single Calls/Puts
    • Vertical Spreads
    • Iron Condors (Iron Butterflies)
    • Covered Stock
    • Combos (Synthetics/Collars)
    • Diagonal Spreads
    • Calendar Spreads
    • Custom Spreads
    • Strangles
    • Straddles
  • Stock Price Distribution Generator - Analyze historical stock price movements patterns to discover potential trade ideas.
  • Trade Scanner - Used to recommend trades based on stock price distributions

Dependencies

You will need Python 3.6.x. It is recommended to install Miniconda3. See requirements.txt for full details.

Installation

pip install optopsy

Usage

python strategies/sample_strategy.py

The sample strategy can be used with Level 3 Historical CSV Data Sample from historicaloptiondata.com.

In order to use it, you will need to define the struct variable to map the column names to the numerical index as per the file format.

optopsy's People

Contributors

michaelchu avatar moue avatar codacy-badger avatar

Watchers

James Cloos avatar  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.