Adaptive ARMD(2) SP500 Trading System

August 29th, 2010 5 comments

Introduction

This article features an adaptive autoregressive momentum ‘trading system’ similar to the Adaptive ARM(3) Trading System. The difference between the ARM model and the ARMD model is that the momentum (delta) periods are adapted. The system trades the very short-term daily trends of the SP 500 stock market index. The two terms (weights) of the model and the delta periods are adjusted walking-forward bar by bar by the swarm adaptation engine. The first delta period ranges from 1 to 3 trading days and the second ranges from 4 to 12 trading days. Both of the terms range from -0.5 to +0.5. The system is  highly dependent on the swarm adaptation engine.

The model is very basic. The indicator value is calculated as follows:

Delta01 = (PriceSeries(t) – PriceSeries(t – Term01Period)) / (Term01Period)^0.5
Delta02 = (PriceSeries(t) – PriceSeries(t – Term02Period)) / (Term02Period)^0.5

Indicator = Term01 * Delta01 + Term02 * Delta02

Term01 and Term02 are the weights of the model and TermPeriod01 and TermPeriod02 are the corresponding delta periods.

If the Indicator value 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 minimum and maximum values for the delta periods were an educated guess and are the default values for the scriptbot.

The performance lookback period was set to 1,000 trading days or approximately 4 years. Once upon a time I had a strong tendency to use performance lookback periods in the range of 20 t0 100 trading days. The basic autoregressive models have been in the scriptbot library for quite a while. They would not perform well when using such short performance lookback periods.

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 Data Settings

Dakota Data Settings

The system will start to produce a trading signal around Jan 1980 (Jan 1976 + 1,000 trading days).

Dakota Bots and Swarm Settings

Dakota Bots and Swarm Settings

There is approximately equal opportunity for any of the whole number values that fall within the Term Period parameter ranges to be output. e.g. The Term 1 Period ranges from 0.51 to 3.49. There are three possible Term 1 Period values used by the model – 1, 2 or 3. Any values for the Term 1 Period that are greater than or equal to 0.51 and less than 1.5 will be rounded to 1. Any values for the Term 1 Period that are greater than or equal to 1.5 and less than or equal to 2.5 (‘banker’s rounding’) will be rounded to 2.

Dakota Equity Management Settings

Dakota Equity Management Settings

The ATS PPIP equity engine calculates the proportion of perfect while in position. The equity engine provides the swarm adaptation engine with performance data over the performance lookback period for each trade bot in the swarm. The performance lookback period has been set to 1,000 trading days or approximately 4 years. The trading delay has been set to zero meaning that the system trades on the close of the current day session.

Image of a Swarm in Action

A 3 dimensional plot of each trade bots position within the  adapted parameter space appears below. Bots that are green are producing positive performance over the performance lookback period and bots that are red are producing negative performance. Half of the trade bots are ghost bots and are fixed in position. Signals generated by the ghost bots are not used by Dakota when generating the trading signal. The bunch of green bots toward the bottom of the image belong to the flocking swarm that produce the trading signals that are average to produce the final trading signal on a bar by bar basis.

Dakota 3D Swarm

Dakota 3D Swarm

Trading Simulation Results

The Dakota Price, Signal and Equity chart appears below.

Dakota Price Signal and Equity Charts

Dakota Price Signal and Equity Charts

The equity curve was reasonably consistent across the 30 year period from 1980 to date. Note that periods of higher volatility will result in the equity curve appearing less consistent. If a position sizing strategy was applied that reduced exposure during periods of higher volatility then the equity curve would appear much smoother than it does in this image.

The Dakota Trade Report follows.

Dakota Trades Report

Dakota Trades Report

The percent of perfect is 9%. This is reasonable for a system that spans thirty years and a number of very different market regimes. The edge is a slight one, but it just might be good enough for incorporation into a system of systems built for trading a mutual fund that closely tracks the S&P 500. A more complete trading simulation will be the topic of a future post.

A report that lists what the trading signal will be over a span of potential closing values for the S&P 500 can be created by running a series of simulations. This would make trading make trading on the current close possible. I know that at least one mutual fund will take orders right up until 5 minutes before the bell rings for stocks in the S&P index. There may be times when the S&P 500 index moves dramatically within the last 5 minutes and the ‘wrong’ position is taken, however, I don’t think this would be a show stopper.

Regards,

James

Categories: Research and Development Tags:

2010 End of Summer Sale!

August 26th, 2010 No comments

AdaptiveTradingSystems.com is offering discounted software packages that include either a Dakota Standard EOD or Dakota Sponsor EOD license plus the complete AdaptiveTradingSystem.com package for Dakota.

Here is the link -> http://www.adaptivetradingsystems.com/end_of_summer_promo.html

Regards,

James

Categories: General Tags:

Adaptive DV2 SP500 Trading System

August 22nd, 2010 No comments

Introduction

This article features an adaptive version of David Varadis’ unbounded DV2 indicator applied to the SP 500 index on a daily time frame. Check out the DV indicators website to learn about David’s superb indicators. The DV2 indicator is calculated by dividing the close by the average of the high and the low for the day. The results for the most recent trading day and the trading day prior to that are averaged to arrive at the final DV2 indicator value.

The implementation of the DV2 featured here is slightly different because a DV2 period and smoothing period are configured as adapted system parameters. The DV2 period is implemented by using the highest high and lowest low over the last n trading days in the forumula. Also, there is a third adapted parameter that determines if the DV2 indicator functions as a trend following indicator or as a mean reversion indicator. Note that trading day highs and lows are very accurate for the SP 500 index, therefore it does not represent the ideal time series for application of the DV2 indicator.

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 DV2 Period ranges from 0.51 to 3.49. This range was used because it assigns an approximately equal range to each of the possible 3 integer values for the DV2 Period. For example, if a given trade bot has a DV2 Period value of 0.61 then this will be rounded to 1 and 3.48 would be rounded to 3. The SMA Period is assigned the same range for the same reason. I wanted to use short term periods because the DV2 as implemented by David Varadi uses shorter term periods.

There is a third adapted parameter (not visible) named Counter Indicator that ranges from 0 to 1. Values less than 0.5 are rounded to zero and result in the indicator functioning in a trend following mode. Values greater than or equal to 0.5 result in the indicator functioning in a mean reversion mode. That is, when the indicator value is above upper threshold go short.

The Lower and Upper Thresholds are fixed at zero. The thresholds could be adapted or set to extreme values. I haven’t tried adapted thresholds for the DV2 at the time of writing this article.

The Equity Management settings are as per the Adaptive ARM(4) Trading System. Basically, frictionless trading with a Performance Lookback period of 1,000 trading days using the PPIP (proportion of perfect trading in position) equity engine.

Visual Peek at a Swarm in Action

The image below is of a 3 dimensional plot of each trade bots position within the  adapted parameter space. Bots that are green are producing positive performance over the Performance Lookback period and bots that are red are producing negative performance. Half of the trade bots are ghost bots that are fixed in position. Signals generated by the ghost bots are not used by Dakota when generating the trading signal.

3D Swarm

3D Swarm

The green bunch of trade bots that appear toward the top of the graph are the flocking bots. Signals produced by the flocking bots are used in the generation of the trading signal. All of the flocking bots have a Counter Indicator value that is above 0.5 meaning that at the bar the image was taken the DV2 indicator was functioning as a mean reversion indicator.

Results

The Dakota Price, Signal and Equity chart appears below.

Dakota Price Signal and Equity Charts

Dakota Price Signal and Equity Charts

It is difficult to see in the above image, but the equity curve prior to the market crash in October 1987 was reasonably consistent. During the period leading up to Oct 1987 the DV2 indicator was functioning as a trend following indicator. From approximately 1992 onwards the DV2 indicator was functioning as a mean reversion indicator.

The Dakota Trade Report appears below.

Dakota Trades Report

Dakota Trades Report

The overall trade statistics are not outstanding. This is probably due to a longish mediocre period from 1987 to approximately 2000. However, the approach looks very promising and deserves more work.

Regards,

James

Categories: Research and Development Tags: