Giter VIP home page Giter VIP logo

backtrader-oandav20's Introduction

backtrader-oandav20

Build Status

Support for Oanda-V20 API in backtrader

This integration is still under development and may have some issues, use it for live trading at your own risk!

We are looking for contributors: if you are interested to join us please contact us

What is it ?

backtrader-oandav20 is a package to integrate OANDA into backtrader. It uses the v20 API of OANDA. It can be used with demo or live account. We highly recommend to have a specific account to use backtrader with OANDA. You should not trade manually on the same account if you wish to use backtrader.

It includes all necessary utilities to backtest or do live trading:

  • Store
  • Broker
  • Data Feeds
  • Sizers

Available features:

  • Accessing oandav20 API
  • Streamming prices
  • Streamming events
  • Get history price for backtesting
  • Replay functionality for backtesting
  • Support different type of orders:
    • Order.market
    • Order.Limit
    • Order.Stop
    • Order.StopLimit (using Stop and upperBound / lowerBound prices)
    • Order.StopTrail
    • Bracket orders are supported by using the takeprofit and stoploss order members and creating internally simulated orders.
  • 4 different Sizers:
    • OandaV20Percent - returns position size which matches the percent amount of total cash
    • OandaV20Cash - return position size which matches the cash amount
    • OandaV20RiskPercent - returns position size which matches the total risk in percent of total amount (max stop loss)
    • OandaV20RiskCash - returns position size which matches the total risk in percent of total amount (max stop loss)
  • Possibility to load existing positions from the OANDA account

Required dependencies

Installation

No package is available at the moment so you need to install it manually. The following steps have been tested on Mac OS High Sierra and Ubuntu 16 and 18.

  1. Install backtrader pip install backtrader[plotting] (https://www.backtrader.com/docu/installation.html)
  2. Download a zip file of the master branch
  3. Extract the zip files
  4. Copy the btoandav20 into your own working directory
  5. Install dependencies:
    • pip install pyyaml
    • pip install v20
  6. Import btoandav20 into your script: import btoandav20 (this is considering your script is at the root of your folder)
  7. You can then access the different such as :
    • Store: btoandav20.stores.OandaV20Store
    • Data Feed: btoandav20.feeds.OandaV20Data
    • Broker: btoandav20.brokers.OandaV20Broker
    • Sizers: btoandav20.sizers.OandaV20Cash (other sizers are available)

If you encounter an issue during installation, please check this url first: https://community.backtrader.com/topic/1570/oanda-data-feed/13 and create a new issue if this doesn't solve it.

Get Started

See the example folder for more detailed explanation on how to use it.

License

All code is based on backtrader oandastore which is released under GNU General Public License Version 3 by Daniel Rodriguez

backtrader-oandav20's People

Contributors

ftomassetti avatar happydasch 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.