Backtesting

Discussion in 'Automated Trading' started by DanFenner, Feb 9, 2010.

  1. In my opinion.... due to the market's natural upward tendencies and human optimism bias there is a much better chance of seeing buying support in a selloff than selling pressure in a rally.

    It's also much easier to scale since you won't have to deal with locating shares and there is a finite risk per position.

    I'll be posting some of the backtest results over the next few days to get input.
     
    #11     Feb 10, 2010
  2. Here's the first set of backtest results.

    To maintain discretion I posted only values and no equations, etc, but it should be enough to provide an understanding.

    Please offer suggestions as to what other data I could extract, what figures I'm missing, and if you believe a system that produces these returns is worthwhile/viable to raise money with.

    Also, psytrade, please check on the Sharpe calc and tell me if you think I got it right this time. Thanks!
     
    #12     Feb 10, 2010
  3. This looks really nice, but as I understand calculating sharpe ratios on trades, you calculate the average based on single calculations AVG(Max(Loss or Gain)-RiskFreeRate)/STDEV of daily returns)

    Summing up the entire trade result as it looks like you did would likely distort the Sharpe ratio to be higher.

    I'm also confused how you calculate the daily Drawdown. It's the portfolio as a whole that matter, not individual trades.. so this confused me.

    I see Daily Total Return - but 9/10/2008 I believe has a -70% drawdown... If thats the actual drawdown of an account, IMO its 3-5 times too risky.
     
    #13     Feb 10, 2010
  4. Hmmm

    So you're saying I should take the overall average daily gain, subtract the daily Rf, and divide by the StDev of the daily hi/lo average?

    The figures are all based on the individual trade event, not a portfolio. To put it in portfolio terms would require specifics such as portfolio size, trade allocation per event, leverage available, etc which would be different for most investors and therefore irrelevant to the majority.

    The 70% is only on the avg trade size (or the allocated size). This would only represent an account DD of 70% if an individual was allocating 100% of his capital to every event, and was able to use massive leverage.

    I hope this clears things up a little, though I'm still foggy on the portfolio vs trade aspect of the system evaluation and the Sharpe ratio.
     
    #14     Feb 10, 2010
  5. If a number is this difficult to calculate, interpreting it's meaning will be doubly so.
     
    #15     Feb 10, 2010


  6. I cleaned up the data a bit and put it more in portfolio/investor terms. Now the contributed capital in the example is $100k with access of up to $1mm intraday, though the full amount is accessed less than 6% of the time, and $500k or above is accessed less than 8% of the time.

    Please tell me what you think.
     
    #16     Feb 11, 2010
  7. You need to convert all the trading events to something
    on a portfolio level. Add these rows:

    Trade Event | % Of Portfolio Risked | % of Portfolio Daily Net Gain or Loss

    Do this repeatedly for each day and then calculate your sharpe...

    Because it seems like you are only calculating trades when they end, correct me if I'm wrong, when you need to calculate the daily up and down moves for all positions (i.e Trade Events)

    Trade events themselves aren't that important. It's how they operate in unison or in a group over time that effects the sharpe ratio and in general the palatability of the system.

    Without knowing how much was to be risked on each trade, it doesn't give you an idea of the properties of the system.

    If you agree to lose no more than 3% of your capital on the majority of trades, you have to size the positions and create the appropriate stops (or hedges) accordingly.

    From a number like 3% risked for each trade, you could determine that your positions be sized in accordance to some indicator (such as expected slippage, stdev of the stock, or atr, etc) with a maximum position size allotted to 3% risk. You would then plug that number into your system and determine what the actual annual return is for a given amount of trade risk. This would give you a ball park return which you could generate from this data you already collected.

    I would say 3% max trade risk at entry, and perhaps a net directional risk of 10% daily portfolio risk. You could then reverse engineer a method to size your positions and figure out what kind of acceptable level of risk will generate the returns you think your trade events can get you.

    I would try and develop a systematic method that sizes your positions based on some statistical properties of your system.. say via a signal level, risk measure, etc, this would make your system rock solid and it if has predictive value and good risk control, you could see that easily and other people would like the transparency that kind of system has. The best system knows when it cannot measure something, and gets to cash or fully hedged.
     
    #17     Feb 11, 2010