/Strategems.jl

Quantitative systematic trading strategy development and backtesting in Julia

Primary LanguageJuliaOtherNOASSERTION

Build Status Coverage Status codecov.io

Strategems

Strategems is a Julia package aimed at simplifying and streamlining the process of developing, testing, and optimizing algorithmic/systematic trading strategies. This package is inspired in large part by the quantstrat1,2 package in R, adopting a similar general structure to the building blocks that make up a strategy.

Given the highly iterative nature of event-driven trading strategy development, Julia's high-performance design (particularly in the context of loops) and straightforward syntax would seem to make it a natural fit as a language for systematic strategy research and development. While this package remains early in development, with time the hope is to be able to rapidly implement a trading idea, construct a historical backtest, analyze its results, optimize over a given parameter set, and visualize all of this with great detail.

Anatomy of a Strategy

Below are the basic building blocks making up the general anatomy of a Strategy with respect to the Strategems.jl package design and the type definitions used to facilitate the research workflow.

  • Universe: encapsulation of the assets/securities the strategy is to be allowed to trade
  • Indicator: calculation done on each asset in the universe whose results we think have predictive potential for future price movement
  • ParameterSet: inputs/arguments to the indicator calculations
  • Signal: boolean flag sending messages to the trading logic/rules to be interpreted and acted upon
  • Rule: applications of trading logic derived from interpretations of prior calculations & signals at each time step
  • Strategy: overarching object encapsulating and directing all of the above logic and data to power the backtesting engine

Roadmap / Wish List

  • Get a sufficiently full-featured type system established to facilitate easy construction of simple strategies
  • Allow more intelligent logic for trading rules
    • Adjust order sizing based on portfolio/account at time $$t$$
    • Portfolio optimization logic
    • Risk limits
    • Stop loss rules
  • Define a more diverse set of order types
    • Limit orders
    • Stop orders