Home > Educational Articles > A Brief Introduction to Dakota and Particle Swarm Adaptation

A Brief Introduction to Dakota and Particle Swarm Adaptation

November 13th, 2008 Leave a comment Go to comments

At AdaptiveTradingSystems.com we use BioComp Dakota to increase the degree to which our models adapt to changing market conditions. I’d like to present some R&D that I hope you will find interesting and possibly useful. I have built two Dakota systems based on the application of a VIX model to the SP futures contract. Michael Stokes presented the VIX model in his blog at http://marketsci.wordpress.com/2008/07/28/the-vix-is-very-predictable/.

The systems use reverse adjusted continually linked SP futures data sourced from Pinnacle Data Corp. The VIX (S&P 500) data is from the Pinnacle IDX database. Hypothetical trades are opened and closed MOC on the trading day following the day that the signals are generated. No transaction costs are included i.e. frictionless trading. The hypothetical historical performance of both systems is measured from 3/16/1997 to 10/7/2008.

The first system has the EMA and SMA periods fixed at 11 trading days. The equity curve is decent enough. A total of $533,312 in hypothetical profits was accumulated over the period. A graph of the hypothetical equity curve for the system that uses fixed parameter values follows.

SP MACDEMASMA VIX Fixed Params Equity Curve

SP MACDEMASMA VIX Fixed Params Equity Curve

The second system has both the EMA and SMA Min periods set to 8 and the Max periods set to 14. I subtracted 3 from 11 to come up with 8 and added 3 to come up with 14. This gives the system the potential to adapt to changing market conditions. The second swarm produced a hypothetical profit of $695,962 and the equity curve was smoother. A graph of the hypothetical equity curve for the system that uses particle swarm adaptation to determine the parameter vales to use walking-forward  follows.

SP MACDEMASMA VIX Adaptive Params Equity Curve

SP MACDEMASMA VIX Adaptive Params Equity Curve

As Dakota ‘walks-forward’ through the data from March 1997 up to date, it calculates the trading signal by averaging the signals from 35 ‘trade bots’. A trade bot is equivalent to a particle in Particle Swarm Adaptation. You can define the number of trade bots to use. I usually use 35. Each trading day, any given trade bot can potentially have any combination of parameter values that fall within the parameter ranges. For example, trade bot number 1 on trading bar number 1345 is using an EMA period of 10 and an SMA period of 11. On trading bar number 1346 trade bot number 1 is using an EMA period of 11 and an SMA period of 11.

Two key components of Dakota are the Equity Engine and the Swarm Adaptation Engine. The Equity Engine measures the performance of each trade bot on each trading day walking-forward. The Performance is measured over the ‘lookback period’. The default value for the lookback period is 50 trading days and this is the value that I normally use. The performance data is passed to the Swarm Adaptation Engine.

The job of the Swarm Adaptation Engine is to calculate new parameter values for each trade bot within the parameter space for the trading day being processed. For the second system above, the parameter space is 8 to 11 for both the EMA period and the SMA periods. I have built my own Swarm Adaptation Engine based on studying papers written by experts in the field that ‘plugs in’ to the Dakota application. Some original concepts of my own are in there too.

In summary, if you have a decent model to start with, then you can improve upon it by making use of Particle Swarm Adaptation. I have been asked the question “Why not just calculate the best parameters over the lookback period and use those each trading day walking forward”. More often than not, the historically ‘best’ parameter values are not the best ones to use moving forward. The best parameter values to use moving forward are more likely to be in the vicinity of the historically best values, but equal to them. Swarm Adaptation is a step up from the more basic types of curve fitting.

Regards,

James

Adaptive Trading Systems

Share and Enjoy:
Categories: Educational Articles Tags:
  1. No comments yet.
  1. No trackbacks yet.