13.08.2022 Views

advanced-algorithmic-trading

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

352

While vectorised backtests are simple to code they are often severely lacking in respect of

proper implementation details. Transaction costs are usually ignored and "nitty gritty" implementation

details are idealised in order to minimise code complexity.

This motivated the philosophy and subsequent development of QSTrader. QSTrader has

been designed to provide a realistic simulation environment that attempts to mirror the live

deployment of a trading strategy as much as possible. For instance, realistic brokerage fees are

turned on by default–an unusual design choice compared to many other backtesting systems.

It is the author’s wish that the presented backtests of trading strategies within this book

are as realistic as possible. This provides readers with a detailed insight into their real-world

performance before deciding to trade them live.

Another motivating goal for QSTrader was to ensure that it was freely available by releasing

it under a permissive open source license (the MIT license). This was to encourage contributions

from the wider community. It has been developed and tested in Python 2.7.x, 3.4.x and 3.5.x to

allow straightforward cross-platform compatibility.

In the twelve months since development began QSTrader has attracted more than a dozen

volunteer developers, of which five have made significant contributions, with three in particular

having provided exceptional contributions to the project. The author would like to personally

thank Ryan Kennedy, Femto Trader and Nick Willemse for their extensive generosity and

fantastic contributions to the QSTrader project.

QSTrader is strongly influenced by another QuantStart project–QSForex–also available under

a permissive open-source license. QSForex only supports one brokerage–OANDA–via their

RESTful API. QSTrader, however, is being developed to connect to the newly released Interactive

Brokers Python API, which was released very close to the publication date of this book.

The eventual goal is to allow equities, ETFs and forex to all be traded under the same portfolio

framework.

The project page of QSTrader will always be available on Github at https://github.com/

mhallsmoore/qstrader. Please head there in order to study the most recent installation instructions

and documentation.

Ultimately, QSTrader will be used for all of the trading strategies within this book. At this

stage however it is under active development both by the author and the community. As new

modules are released the book, strategies and their performance will be updated.

24.2 Design Considerations

The design of QSTrader is equivalent to the type of bespoke algorithmic trading infrastructure

stack that might be found in a small quantitative hedge fund manager. Thus, the author considers

the end goal of this project to be a fully open-source institutional grade production-ready portfolio

and order management system, with risk management layers across positions, portfolios and the

infrastructure as a whole.

QSTrader will eventually allow end-to-end automation, meaning that minimal human intervention

is required for the system to trade once it is set "live". It is of course impossible to

completely eliminate human involvement, especially where input data quality is concerned as

with erroneous ticks from data vendors. However it is certainly possible to have the system

running in an automated fashion for the majority of the time.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!