Code Monkey home page Code Monkey logo

quantfxengine's Introduction

quantfxengine is a project of mine for quantitative forex trading at OANDA.

It is based on code from quantstart.

CAUTION: ALGORITHMIC TRADING IS A WAY TO LOSE LOTS OF MONEY VERY FAST. IF YOU DO NOT KNOW; WHAT YOU ARE DOING, DO NOT TRADE ON LIVE ACCOUNTS. Practice accounts are okay.

You can start this stuff with python trading/trading.py

Also you probably want to have a look at settings.py. If you want to trade with OANDA with this programm, you need to have your account id in the environment variable OANDA_API_ACCOUNT_ID and your access token in OANDA_API_ACCESS_TOKEN.

Backtesting is also possible if you have a suitable csv-file.

If you want to adjust the logging, look at logging.conf.

##Packages Before you can start, you need the following python-packages: -requests

##How it works The main function is in trade/trading.py. We open two threads, one who streams prices from a file or from a broker in streaming/streaming.py. This adds TickEvents to the queue which the two threads use to communicate.

The second thread handles the Events in the queue. TickEvents get handled by the strategy module, which can then trigger SignalEvents. The portfolio also looks at TickEvents to track the price of open positions.

The portfolio class looks at the SignalEvents and if it fits in the risk assessment, it throws OrderEvents.

OrderEvents get executed by the execution module. That means that we buy or sell. The execution class then throws FillEvents, which include the price for which the Order was filled. This can be different from the price at which the decision to invest was made.

FillEvents get handled by the portfolio to keep track of the current positions.

#Other Tests are done with nosetests and are bundled per object in a separate folder.

quantfxengine's People

Watchers

 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.