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.
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 tradeIndicator
: calculation done on each asset in the universe whose results we think have predictive potential for future price movementParameterSet
: inputs/arguments to the indicator calculationsSignal
: boolean flag sending messages to the trading logic/rules to be interpreted and acted uponRule
: applications of trading logic derived from interpretations of prior calculations & signals at each time stepStrategy
: overarching object encapsulating and directing all of the above logic and data to power the backtesting engine
- 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
- Adjust order sizing based on portfolio/account at time
- Define a more diverse set of order types
- Limit orders
- Stop orders