The Open Trading Project

From Open Trading
Jump to: navigation, search

This project is currently paused.

The Open Trading Project is a group of free, open source, cross-platform programs allowing automated algorithmic trading. For now, only the Forex market is supported (that is, trading of currencies).

Anyone can jump in and hack the code so that it fits their needs. The code is hosted here on GitHub. Fork it and do your thing.

The code is published under the Simplified BSD License.


Write your own trading strategies in C++

The Open Trading Project is almost entirely written in C++11 and is aimed at people who know what they're doing. To use this project correctly, you need to understand simultaneously the Forex market and the C++ language.

The current repository only contains one indicator (Simple Moving Average or SMA), one signal (simple SMA crossing) and one actor (trailing stop). These 3 algorithms serve as an example to help new users understand how the Open Trading Project works. This means that if you want to implement your own strategy, there is work to be done.

Notice the use of the three words: signal, actor and indicator. The combination of those three elements forms a strategy. This is the vocabulary used in the project, and it directly corresponds to C++ classes.

The trading server runs the strategies and sends trading orders over the network to a market wrapper, which then passes the orders to the Forex broker. Given this architecture (generic server + market wrapper), it's possible to trade on any platform (even Bitcoin) if the wrapper exists. Read more about the general architecture of the project.

The backtester allows the testing of a strategy before using it live. It has an optimization functionnality to find the best parameters for a strategy for a certain period of time. It can also generate Gnuplot graphs of the backtest result.

Please, feel free to contribute. The best way to do so is to request a pull on GitHub, and to edit this wiki with more information, tutorials and documentation. When you contribute, please respect the project's coding standard.


Key features

  • Highly cross-platform open source code
    • Only well known and maintained open source libraries are used
    • Works on GNU/Linux, Windows, and on a lot more platforms
    • You, and everyone else, benefits from the contributions of the community
  • A generic trading server, compatible with any broker/Forex API if provided with the correct market wrapper
    • It can run as a graphical application, allowing user interaction
    • Or it can used as a command line application, which can run on a dedicated server
  • A powerful backtester, allowing extensive testing and optimization of trading strategies
  • Write your own trading strategies in C++ with the help of this wiki and available documentation
    • Possibility of doing things that no other automated trading platform can do, like browsing price history at high C++ speeds (STL containers)
  • No "black box", no surprises
    • You control everything and can check, edit and add functionnalities at any time (project under the Simplified BSD License)

What is NOT provided

  • Hedging (opening multiple positions at the same time)
  • Trading something other than a currency
  • The skill needed to write in C++, to build and run C++ programs, and to use the git versioning system


All of these features (and non-features) are susceptible of change according to the roadmap of the project.



For now, there is no separate "release" of the project.

GitHub project page

To get the code, you have two choices:

  • Clone the git repository from GitHub (recommended)
  • Download a tarball archive of the repository (don't do that, you'll lose the benefits of the magnificient git versioning system)

You will then need to build the project.


There is not a lot to see, knowing that the goal is to have an algorithm run for days giving trading orders over the network. Nevertheless, there are some graphical things visible depending on how the server or backtester are configured.

Trading server
Backtest result
Backtest result (zoomed)


Personal tools