Adaptive ARM(3) SP500 Trading System

August 9th, 2010 No comments

Introduction

This article features an adaptive autoregressive momentum ‘trading system’ similar to the Adaptive Autoregressive Trading System presented in the prior article. The system trades the very short-term daily trends of the SP 500 stock market index. The three terms (weights) of the model are modified walking-forward bar by bar by the swarm adaptation engine and they each range from -0.333 to +0.333. Thus, the system is highly dependent on the swarm adaptation engine.

The model is very basic. The predicted change in price (PD) is calculated as follows:

PD = Term1 * (Price(t) – Price(t-1)) + Term2 * (Price(t) – Price(t-2)) / 1.4142 + Term3 * (Price(t) – Price(t-3)) / 1.7321

If PD is positive then the system goes long and vice versa. The simplicity of the model and the uniform ranges across the terms leaves little opportunity for curve fitting prior to the system being run. The performance lookback was set to 1,000 trading days. This model calculates all price deltas by subtracting prior closing values from the last closing value.

System Settings

The trading system simulation was run using SP 500 stock index data from 1980 to present. This period featured a number of very different market regimes. The screen images that follow describe the Dakota system settings.

Dakota Bots and Swarm Settings

Dakota Bots and Swarm Settings

The Price-ARM03 ScriptBot has been in the ATS ScriptBot Library for BioComp Dakota for some time. Default ScriptBot parameter settings were used to build the system featured in this article.

The Dakota Equity Management settings are identical to those described in the prior article. No slippage or commission was applied.

Trading Simulation Results

The screen images that follow show the results of running the trading simulation.

Dakota Price Signal and Equity Charts

Dakota Price Signal and Equity Charts

Overall, the equity curve produced by the ARM(3) model is more consistent then that produced by the AR(3) model in the prior article.

Dakota Trades Report

Dakota Trades Report

The hypothetical performance statistics for the ARM(3) model are slightly better than those produced by the AR(3) model.

Regards,

James

Categories: Research and Development Tags:

Adaptive Autoregressive SP500 Trading System

August 7th, 2010 2 comments

Introduction

This article features an adaptive ‘trading system’ based on the good old autoregressive model. The system trades the very short-term daily trends of the SP 500 stock market index. The three terms (weights) of the model are modified walking-forward bar by bar by the swarm adaptation engine and they each range from -0.333 to +0.333. Thus, the system is highly dependent on the swarm adaptation engine.

The model is very basic. The predicted change in price (PD) is calculated as follows:

PD = Term1 * (Price(t) – Price(t-1)) + Term2 * (Price(t-1) – Price(t-2)) + Term3 * (Price(t-2) – Price(t-3))

If PD is positive then the system goes long and vice versa. The simplicity of the model and the uniform ranges across the terms means there is little opportunity for curve fitting prior to the system being run. Although, there was one optimization step taken. Initially the system was run with a performance lookback of 250 trading days. The equity curve was looking inconsistent so the run was stopped and the performance lookback was increased to 1000 trading days. No periods for the performance lookback were tested between 250 and 1000 trading days.

System Settings

The trading system simulation was run using SP 500 stock index data from 1980 to present. This period featured a number of very different market regimes. The screen images that follow describe the Dakota system settings.

Dakotan Bots and Swarm Settings

Dakotan Bots and Swarm Settings

The Delta Period is set to 1 which means bar by bar changes in price are used. If the Delta Period was set to 2 then the first change in price would be calculated by taking the last closing value minus the closing value two trading days ago and the second change in price would be calculated by taking the closing value one trading day back minus the closing value 3 trading days back.

Dakota Equity Management Settings

Dakota Equity Management Settings

Performance is calculated using the proportion of perfect while in position (PPIP) equity engine. The Performance Lookback period is set to 1000 trading days and the system trades on the current close of the market. A system of this nature could be used to trade the SP/ES futures because there would be time to update the data and bring the system up to date. Note, I am not suggesting that this would be appropriate for this particular system. No slippage or commission was applied.

Trading Simulation Results

The screen images that follow describe the results of running the trading simulation.

Dakota Price, Signal and Equity Charts

Dakota Price, Signal and Equity Charts

The equity curve shows that the system managed to adapt reasonably well over various changes in market regimes. It was interesting to see what quadrants the trade bots occupied while the system was running. Changes in market regimes were easily identified.

Dakota Trades Report

Dakota Trades Report

The percent of perfect was reasonable at 8.9%. However, the system only had a slight edge on the market with approximately 50% profitable trades. Perhaps a slightly more sophisticated model, along the same lines, would result in a more substantial edge.

Regards,

James

Categories: Research and Development Tags:

Countertrend / Trend Following SP Trading System

August 4th, 2010 No comments

This article features a trading system for the ES/SP futures that opens trading positions counter to the short term trend when the long term trend is also counter to the short term trend. Long positions are closed when the price exceeds a shorter term simple moving average and vice versa.

The trading system was built using BioComp Dakota to enable walk-forward adaptation of the system parameter values. The system was run using daily reverse adjusted SP futures data, provided by Pinnacle Data Corp., from Jan 1994. No trading signals were generated until Jan 1995 because the performance engine requires approximately one year of data before outputting trading signals.

The screen images that follow show the Dakota system settings that were used.

Dakota Bots and Swarm Settings

Dakota Bots and Swarm Settings

A description for each of the key trading system parameters follows:

  • The Min Values Above/Below Last ranges from 4 to 9 trading days. For a long signal to be generated the n prior closes for the SP contract must be above the last close and vice versa. i.e. the market must be at a short term new low to go long or a short term new high to go short.
  • The MA Trend Period ranges from 100 to 300 trading days and the Trend Threshold ranges from 0% to 5%. For a long position to be generated, the last close of the SP contract is required to be above the SMA or the last close is required to be within the threshold percentage of the SMA and vice versa. i.e. If the last close is within +-x% of the SMA then both long and short positions can potentially be output.
  • The MA Exit Period ranges from 2 to 12 trading days. If the trading system is long and the last close exceeds the SMA then the position is closed and vice versa.
Dakota Equity Management Settings

Dakota Equity Management Settings

The Proportion of Perfect while In Position (PPIP) Equity Engine is selected and a 250 trading day Performance Lookback period has been set. The Trading Delay is set to 1 trading day. i.e. The system trades on the close of the trading day that follows the trading day that has just been processed. No commission or slippage was used. i.e. Results are frictionless.

The screen images that follow show the hypothetical trading results of running the system.

Dakota Price, Signal and Equity Charts

Dakota Price, Signal and Equity Charts

There are some prolonged flat periods in the equity curve and the system didn’t manage to capture some of the very significant declines. These criticisms aside, overall the equity curve is quite consistent and sure beats buy and hold.

Dakota Trades Report

Dakota Trades Report

The average trade period is 3.4 trading days, percent time in position is 31.4%, percent winning trades is 63% and the average winner is about equal to the average loser. If this trading signal was actually traded, versus contributing to a meta-system, then slippage and commission would have to be minimized. Given that the system signal is applied on the close of the next trading day, minimizing slippage is not difficult. Hopefully this article has given others some ideas to work with.

Regards,

James

Categories: Educational Articles Tags: