1
Blackalgotechnologies.com
BLACK ALGO METHOD
Strategy Development Guide
Our Guide For Building Long-Term Profitable Trading Robots
Content
1.
Our Aim and Philosophy
2.
Main Components of a Strategy
3.
Idea Generation
4.
Backtesting Framework
5.
Optimisation Framework
6.
Portfolio of Robots
Disclaimer: This guide serves as a brief overview of our strategy development process.
For more information on
1) Robot Design and Market Theories
2) Complete Strategy Development Process
3) Coding
4) Data Management
5) Live Trading: Implementation, Performance Analysis and Risk Management
Please go to
www.algotrading101.com
Log:
v2.0 - May 2015 (Current)
v1.2 - Oct 2014
v1.1 - May 2014
v1.0 - May 2012
3
Blackalgotechnologies.com
Aim:
To build a long term profitable portfolio of trading robots by exploiting persistent market inefficiencies
Our Philosophy:
Design robots using low frequency mathematical models using market-prudent ideology
Market-Prudency: Ideas that are fundamentally sound from a market and economic point-of-view
Mathematical Models: These are strategies tested based on sound statistical methods
Low frequency: The trading frequency of our models are low (defined as less than once a minute). Our strategy DOES NOT depend on the speed/computing capacity of our hardware/software
Main Components of a Strategy
Entry
Rules for entering a trade
Exit
Rules for exiting a trade
Position Sizing
Rules to determine our trading size
Main types:
% of capital risked
Volatility-based
Scaling or reduction
Kelly Criterion
Minimum Sizing (Monte Carlo Worst Case)
Adaptive Sizing (Machine Learning)
Idea Generation
Types of Inefficiencies
Macroeconomic news: Non-farm Payroll, FOMC Policy… Fundamentals: Revenues, Earnings release, cash flow… Statistical: Correlation, Cointegration…
Market Microstructure: State of the limit-order book, Arbitrage…
Types of Strategies
Directional
Market Neutral (Paired or hedged positions)
Derivatives-based/Complex (Strategies involving complex derivatives: CDS, Options, Swaps etc. Generally this refers to instruments involving non-linear and conditional payouts)
Vetting Ideas
Factors to consider:
Market-Prudent (Logical from economic, markets point-of-view) Identifiable
Persistent inefficiency (as opposed to one-off inefficiencies) Effect from transaction cost
Survivorship Bias
5
Blackalgotechnologies.com
Aim
To gain a better understanding of our Robot.
Checking for Trade Accuracy
Verify if the code reflect the correct trading rules
Checking for Robustness
Official Definition of Robustness: In economics, robustness is the ability of a financial trading system to remain effective under different markets and different market conditions, or the ability of an economic model to remain valid under different assumptions, parameters and initial conditions.
In English: A robot is robust if it can remain effective in changing market conditions
Types of Robustness
Period Robustness Seasonal Robustness Timeframe Robustness Instrument Robustness Parameter Robustness Optimisation Robustness Portfolio RobustnessStrategic Period Selection
Building robots for specific market conditions that exist in selective periods (Eg. Macro conditions: Easing & Tightening)
Black Swans: Stress Testing
Stress testing your robots for black swan events
Grading Your Robot
Criteria to pass the backtesting phase:
Robot succeeds in capturing intended inefficiency (Reality satisfies expectations) Robot survives reasonably through a range of market conditions
Bonus: Robot exceeds expectations in performance and/or robustness
Selecting a Performance Metric
Optimisation Framework
Aim
To maximize performance and robustness of our portfolio (of robots) without curve fitting
Objective Function
This should be similar to our Backtesting Performance Metric. It has to comprise of 1) Reward 2) Risk & Consistency
Parameter Relevance
We only optimise parameters that are relevant to the inefficiency we aim to capture.
Parameter Robustness
Definition: A robot is parameter robust if it is able to remain effective across minor adjustments in parameter values.
In English: Performance of a robot should not change much if we change its parameter values slightly. We prefer a smooth optimisation/parameter space (resembling a plateau) over a spiky one.
7
Blackalgotechnologies.com
The remainder of the data are reserved for out-of-sample testing. A small portion of the reserved data following the in-sample data is tested with the results recorded. The in-sample time window is shifted forward by the period covered by the out-of-sample test, and the process repeated. At the end, all of the recorded results are used to assess the trading strategy.1
In English: We optimise our robot using one period (in-sample), and apply the optimised parameters to the next period (Out-of-sample). Repeat. The performance of the robot is collated using all the out-of-sample periods.
Walk-Forward Efficiency
In addition to evaluating the out-of-sample performance independently, we need to evaluate them in relation to the in-sample performance. Comparing the in-sample and out-of-sample will allow us to understand the effectiveness of our optimisation. This allows us to identify the element of 1) Curve Fitting and 2) Luck/Chance in our robots.
We use a metric called Walk-Forward Efficiency for this.
Consistency of Performance
There may be patterns to our out-of-sample performances over time. Increasing or decreasing performance could be due market inefficiencies worsening or dissipating respectively. Anomalies in performance should be analysed with regards to change in market conditions. This will give insights into the strengths and weakness of our robots.
Ranking Optimisation
No, this has nothing to doing with SEO. Ranking optimisation entails selecting the parameter set that consistently rank well in the parameter space.
Portfolio of Robots
Aim
To design and build a long term profitable portfolio of trading robots
Portfolio Robustness
We seek to design a portfolio of robots that are profitable across varying market conditions
Capital Reallocation
There are two methods to reallocate capital across the robots:
Common Capital Base
All robots trade from the same capital base
Capital is Distributed
Each robot has a certain capital allocated to them. Amount allocated can be evenly or unevenly weighted. Distribution can happen once at portfolio initiation or regularly at fixed interval. The former has a “rewarding effect” on good robots and the latter has a “punishing” effect.
Multiple Parameter Set
We can increase parameter robustness aka reduce variance due to parameter selection by selecting multiple parameter sets for a single robot. These multiple sets act the same way as a portfolio of robots.
Robot Correlation
To understand our portfolio’s effectiveness across different market conditions, we need to understand the correlation between the robots’ performance. This understanding will allow us to optimise for the highest reward-to-(risk & consistency) for our portfolio.
Portfolio Optimisation
As mentioned, we need to optimise for the highest reward-to-(risk & consistency) for our portfolio. Factors/procedures to consider includes: 1) Portfolio Robustness 2) Robot Performance Correlation 3) Capital Allocation and 4) Portfolio Walk-Forward.