Adaptive Trading Strategies

Discussion in 'Strategy Building' started by jalsck, Sep 4, 2010.

  1. Whimsy

    Whimsy Guest

    I see no commissions or slippage in your model. Since your edge is so slight wouldn't they have a significant impact on your profit?
     
    #21     Sep 6, 2010
  2. jalsck

    jalsck

    Some background info:

    The systems posted so far would at best contribute towards a system of systems. The motivation for posting the details of systems on this thread is to show different ways that a model can adapt and to hopefully gain some ideas from other ET members. I am planning to put together a system of systems for the SP 500 and that is when I would included all fees etc.

    Having said that, yesterday I built a rough and ready spreadsheet to simulate trading a leveraged mutual fund using a system very similar to the ones I have presented here. The results using 2x leverage with no compounding from 1980 to present were an average annual return of 30% with a max drawdown of about 50% (high I know). I put the spreadsheet together because I wanted to get some idea of the effect of trading costs.

    If you would like a copy of the spreadsheet then I will upload it here. Remember it is a quick and dirty first cut.

    Good question thank you.

    Best Regards,

    James
     
    #22     Sep 6, 2010
  3. jalsck

    jalsck

    I have attached a chart of the simulated net profit from 1980 to date. The following settings were used.

    Initial Trading Capital: $1,000,000
    Annual Gross Expense Ratio: 1.81%
    Daily AGER Accrual Rate: 0.00496%
    Leverage: 2.00

    The recent ramp up in the equity curve away from the previously established trend makes me wonder if this system will be unprofitable for a while. i.e. Will the equity curve return to the previously established trend? That is neither here nor there though, just an observation.

    Regards,

    James
     
    #23     Sep 6, 2010
  4. Whimsy

    Whimsy Guest

    James:

    No need for the spreadsheet as far as I'm concerned. It's a personal preference - add slippage and costs during initial trials or wait until edge is proven and then add. I'm of the add immediately school.

    I do like the performance shown during the recent "Big Dip" periods. Flat when the market sold off the way it did (or as near as can be guessed in a 30 year chart).

    EDIT: I'm referring to the last red chart, not the blue one in the immediately prededing post
     
    #24     Sep 6, 2010
  5. jalsck

    jalsck

    Hey Ron,

    Still waiting for the results of your quick test...

    Regards,

    James
     
    #25     Sep 8, 2010
  6. jalsck

    jalsck

    #26     Oct 10, 2010
  7. This author wrote an article in AT where he confuses cointegration with corellation for pairs trading

    http://www.activetradermag.com/index.php/c/Trading_Strategies/d/Trading_correlation

    He also thinks that an R of 0.85 between a stock and an ETF means that the ETF is the sun and the stock the planet.

    "If the correlation between an individual stock or ETF and the S&P 500 tracking stock (SPY) is greater than 0.85, the broader market is likely pulling the smaller up or down, rather than vice versa. In a way, SPY functions as the “sun” in the solar system of stocks and ETFs, influencing their behavior significantly. "

    I wonder if AT checks these articles for sanity before publushing them.
     
    #27     Oct 10, 2010
  8. jalsck

    jalsck

    No distinction was made between correlation and co-integration in the portion of the article that was available for me to read. This could be interpreted as using the terms interchangeably, but that's not how I interpreted it. All of the points that were made were spot on.

    In any case, if you are not reading David's blog then you are definitely missing out!

    Best Regards,

    James
     
    #28     Oct 11, 2010
  9. jalsck

    jalsck

    The following is a description of how adaptation is enabled in BioComp Dakota. The concepts can potentially be implemented using other software applications with some effort. There are many different ways to incorporate adaptation into a trading system. This post might provide others with some inspiration.

    BioComp Dakota is a product of BioComp Systems Inc. BioComp Systems provide state of the art modeling, prediction and optimization technologies to corporations and individuals. Dakota is a stand-alone application for building trading systems. The Dakota application framework is flexible thereby, enabling trading systems developers to plug-in their own technical indicators / trading rules, performance engines and adaptation routines.

    One of the strongest features of the Dakota application is that it functions on a 100% walk-forward basis. When price data for given trading period (day) is processed, trading system parameters are adapted using data up to the most recent period. Whether you are building new systems or updating existing systems Dakota runs in 100% walk-forward mode. It is my belief that eventually all trading systems software will operate on this basis.

    Some trading systems software applications run walk-forward simulations by organizing in-sample and out-of-sample periods so that a new out-of-sample period starts when the prior out-of-sample period finishes. This is the approach that we used over 10 years ago. The 'block by block' approach is better than optimizing over the entire simulation period and thereby producing no out-of-sample results. However, the fact that historical optimizations occur over distinct and potentially very different periods introduces numerous issues that are difficult to work around. Dakota is superior because historical optimizations are occurring bar by bar. i.e. There is not a huge 'jump' from one optimization period to the next. This enables smooth adjustments in trading system parameters to take place walking-forward.

    A Dakota trading system is made up of a set of trading robots. The set of bots is referred to as a swarm. Typically, each bot in a swarm is based on the same technical indicators and trading rules. Parameter values for technical indicators and trading rules vary from bot to bot within user defined ranges and are adjusted as new data is processed. Adaptation occurs via the bar by bar adjustments in bot parameter values. The trading system signal is generated by combining the trading signals generated by the bots in the swarm.

    The swarm adaptation engine is responsible for the bar by bar adaptation of bot parameter values. A trading systems developer can use any technology or set of rules to determine how the adjustments are calculated. For example, a given trade bot's parameter values can be moved closer to those of the best performing bot in the swarm as well as the trade bot's best position over the performance lookback period. Any suitable algorithm can be used by the trading systems developer to enable the adaptation process.

    Trading system parameters are generally adjusted gradually period by period by the swarm adaptation engine. Although, relatively rapid adjustments in parameter values occur when significant changes in market behaviour takes place. For example, a simple moving average is used along with some trading rules by each of the 60 bots in the swarm. The length of the SMA is set to vary anywhere from 2 to 30 trading days. Bot number 1 is currently using a 9 period SMA and bot number 2 is currently using a 12 period SMA and so on. The minimum period used by the bots in the swarm is 8 trading days and the maximum is 15 trading days. In 20 trading days time the period of the SMA used by each bot will have potentially changed due to the bar by bar adaptation that is taking place. The minimum period is now 11 trading days and the maximum is 18 trading days.

    The spread in parameter values provided by the swarm of bots is just as valuable as the adaptation process itself. The bots in a swarm will tend to be in the vicinity of the historically best performing bot. The best set of parameter values in the future is often not equal to the parameter values of the currently best performing bot, but will often be in the vicinity of those parameter values. Trading simulations that exclusively use the signal generated by the best performing bot in the swarm always produce inferior results compared to using the average of all bot signals in the swarm.

    If any points are not clear then let me know and I'll do my best to provide a better explanation. If anyone else has some different ideas on how to build adaptive systems then please let us know.

    Best Regards,

    James
     
    #29     Nov 10, 2010
  10. I think someone mentioned it already but it sounds like a bar-after-bar optimization method.

    Let us consider a simple moving average crossover system: SMA(5) > SMA(30). Can you provide a backtest of the performance of the system with Dakota in action?
     
    #30     Nov 10, 2010