• Australian (ASX) Stock Market Forum

Hello and welcome to Aussie Stock Forums!

To gain full access you must register. Registration is free and takes only a few seconds to complete.

Already a member? Log in here.

XAO backtest benchmarks for 2018-2020

Discussion in 'Trading Diaries and Journals' started by qldfrog, Feb 17, 2020.

  1. julieta

    julieta

    Posts:
    9
    Likes Received:
    19
    Joined:
    Oct 19, 2014
    Statistics | Charts | Trades | Formula | Settings | Symbols | Monte Carlo

    Statistics
    All trades Long trades Short trades Buy&Hold (XAO)
    Initial capital
    100000.00 100000.00 100000.00 100000.00
    Ending capital 157805.00 157805.00 100000.00 120870.17
    Net Profit 57805.00 57805.00 0.00 20870.17
    Net Profit % 57.80% 57.80% 0.00% 20.87%
    Exposure % 78.58% 78.58% 0.00% 100.00%
    Net Risk Adjusted Return % 73.56% 73.56% N/A 20.87%
    Annual Return % 58.20% 58.20% 0.00% 21.00%
    Risk Adjusted Return % 74.07% 74.07% N/A 21.00%
    Total transaction costs 2195.00 2195.00 0.00 43.90
    All trades 50 50 (100.00 %) 0 (0.00 %) 1
    Avg. Profit/Loss 1156.10 1156.10 N/A 20870.17
    Avg. Profit/Loss % 23.58% 23.58% N/A 20.87%
    Avg. Bars Held 90.82 90.82 N/A 254.00
    Winners 31 (62.00 %) 31 (62.00 %) 0 (0.00 %) 1 (100.00 %)
    Total Profit 64832.34 64832.34 0.00 20870.17
    Avg. Profit 2091.37 2091.37 N/A 20870.17
    Avg. Profit % 42.56% 42.56% N/A 20.87%
    Avg. Bars Held 107.06 107.06 N/A 254.00
    Max. Consecutive 11 11 0 1
    Largest win 9175.43 9175.43 0.00 20870.17
    # bars in largest win 251 251 0 254
    Losers 19 (38.00 %) 19 (38.00 %) 0 (0.00 %) 0 (0.00 %)
    Total Loss -7027.35 -7027.35 0.00 0.00
    Avg. Loss -369.86 -369.86 N/A N/A
    Avg. Loss % -7.40% -7.40% N/A N/A
    Avg. Bars Held 64.32 64.32 N/A N/A
    Max. Consecutive 5 5 0 0
    Largest loss -846.93 -846.93 0.00 0.00
    # bars in largest loss 41 41 0 0
    Max. trade drawdown -3407.84 -3407.84 0.00 -7862.32
    Max. trade % drawdown -25.86 -25.86 0.00 -6.39
    Max. system drawdown -10059.34 -10059.34 0.00 -7862.32
    Max. system % drawdown -6.09% -6.09% 0.00% -6.39%
    Recovery Factor 5.75 5.75 N/A 2.65
    CAR/MaxDD 9.56 9.56 N/A 3.29
    RAR/MaxDD 12.17 12.17 N/A 3.29
    Profit Factor 9.23 9.23 N/A N/A
    Payoff Ratio 5.65 5.65 N/A N/A
    Standard Error 10545.52 10545.52 0.00 2373.84
    Risk-Reward Ratio 6.68 6.68 N/A 7.43
    Ulcer Index 2.08 2.08 0.00 1.93
    Portfolio">Ulcer Performance Index 25.44 25.44 N/A 8.07
    Portfolio">Sharpe Ratio of trades 0.83 0.83 0.00 N/A
    K-Ratio 0.12 0.12 N/A 0.13
    Expectancy (per $100 inv.) 23.58

    comsec 21.95 per trade buy high sell low in amibroker settings delay 1
     
    Newt, Skate and qldfrog like this.
  2. qldfrog

    qldfrog

    Posts:
    5,135
    Likes Received:
    3,990
    Joined:
    Jun 8, 2008
    01/01/19 to 1/1/20?
    Great numbers :)
     
    Skate likes this.
  3. Skate

    Skate

    Posts:
    2,007
    Likes Received:
    8,976
    Joined:
    Dec 28, 2013
    As Nick Radge is often quoted
    As Nick Rage is often quote let's read what he has to say about slippage.

    Nick Rage -11% slippage (Ouch)
    "The opening auction has many benefits which is key reason why we use it in our Portfolio. It is one of the most liquid parts of the day allowing a reduction in slippage (the difference between where you want to buy and where you actually buy).

    Lastly take into consideration the timeframe of the strategy and what impact the slippage has on the bottom line. Shorter term traders will be impacted significantly more by slippage and could be so adversely affected that the strategy can't actually generate a worthy return. If this is the case, then look at higher turnover shares, such as the ASX-100, head over to the US where liquidity is substantially higher, or diversify across multiple strategies where the allocation will be smaller. Longer term traders aren't penalized to such an extent as they're looking for moves in terms of dollars rather than cents.

    Well, I did a little exercise recently. I went back through three years of my trading on the ASX and I calculated exactly my wanted buy points, my theoretical buy points according to my strategy, and my realtime buy points in the market. And on average, I was paying $92 per trade for the last three years on every single trade. In other words, the slippage was costing me over 11% per annum. So, not only did I have to overcome the commission drag, but the drag of the slippage meant that I had to be making more than 11% just to break even. And that’s way too much. Now, I was trading the top 200 stocks. So, it just goes to show how illiquid the Australian market is at this juncture. And if you’re going to scale this kind of a strategy, it’s going to blow up in your face"

    Skate.
     
    Padowan, Newt and qldfrog like this.
  4. Skate

    Skate

    Posts:
    2,007
    Likes Received:
    8,976
    Joined:
    Dec 28, 2013
    @Newt would you please repost the last graphic again (1/1/19 - 1/1/20) as the link is broken for me..

    Newt Capture.PNG

    Skate.
     
    qldfrog likes this.
  5. qldfrog

    qldfrog

    Posts:
    5,135
    Likes Received:
    3,990
    Joined:
    Jun 8, 2008
    3rd link seems ok on my phone but it might have been cached
     
  6. Skate

    Skate

    Posts:
    2,007
    Likes Received:
    8,976
    Joined:
    Dec 28, 2013
    @qldfrog, @Newt it's all good now the graphic is now showing for the (1/1/19 - 1/1/20) in Newts report. As it's important I'll post the backtest results again - I often refer back to previous posts.

    Skate.

    Newts Capture.PNG
     
    Newt and qldfrog like this.
  7. MovingAverage

    MovingAverage Smoke me a kipper

    Posts:
    366
    Likes Received:
    476
    Joined:
    Jan 23, 2010
    Here you go. Back test results of my swing system. I've been live trading this for sometime but these are the back test results for the periods you've identified. These results are based on $100k initial capital, but each position is 20% of capital (not fixed position sizing) with a max of 5 open positions. I've based this on Bell Direct published commission schedule and I've baked in about a 3% slippage which is what my live trades have been running at. I should add that I hate looking at single back test runs as it gives you absolutely no insight whatsoever into a system's behavior and to get a better insight into how a system might perform you really need to look at Monte Carlo results, which is what I've done here. I hate Amibroker's MC analysis as it has several shortcoming so I tend to do my MC using TradeSim, but for simplicity of this thread I'm just including Amibroker's Equity chart for its MC output which in any event is better than just looking at a single backtest run in Ami.

    01/07/18 to 01/01/19

    010718-010119.png

    01/07/19 to 01/01/20

    010719-010120.png

    01/01/19 to 01/01/20

    010119-010120.png
     
    Newt, qldfrog and Skate like this.
  8. MovingAverage

    MovingAverage Smoke me a kipper

    Posts:
    366
    Likes Received:
    476
    Joined:
    Jan 23, 2010
    they do that to me if my buy is >5%
     
    qldfrog likes this.
  9. qldfrog

    qldfrog

    Posts:
    5,135
    Likes Received:
    3,990
    Joined:
    Jun 8, 2008
    Point taken cf MC
    I usually look at the MC results for my systems as i stabilise toward a given code.
    Thanks for your input: some good resilience there in neg markets
     
    Skate likes this.
  10. Newt

    Newt

    Posts:
    509
    Likes Received:
    768
    Joined:
    Oct 17, 2012
    Wow. I had been wondering about putting an extra column in my Excel trading spreadsheet and digging back for this Open price versus filled price. Actually quite shocked at this Radge info. Now thinking Its a must do. Could see from my 1 year foray into MR reversion trading just how detrimental slippage was, particularly in stocks in "rebound mode".

    Looking on the positive, we should consider how fortunate we are that trading costs keep coming down (commissions etc). Sure we have a long way to go in Aus versus US but hopelly the direction is down.

    Hadn't ever considered possible slippage benefit for daily/weekly trend following in US markets versus Aus though.....
     
    Skate and debtfree like this.
  11. Newt

    Newt

    Posts:
    509
    Likes Received:
    768
    Joined:
    Oct 17, 2012
    I spent quite a bit of time last night running backtests for your thread Qldfrog, and frankly was more than a bit peeved how poor the returns were on my Amibroker reports. After checking there were no obvious coding errors while implementing the standard stock universe (All Ords), slippage, number of positions, compounding etc decided to sleep on it.

    Occured to me today that unfavourable or unexpected results from any experiement (in science or financial endeavours) means you're probably about to learn something new :) If anyone else learns something that should be in the spirit of what ASF is about too.....

    Skate posted quite a few backtests in the Dump it Here thread yesterday morning that got me thinking.
    https://www.aussiestockforums.com/threads/dump-it-here.34425/page-119
    (posts 2379 and 2380)
    CAM appears to be not too far distant from the weekly ASX system I'm running that I would hope to be "in the ball park" with not to dis-similar returns. PANDA seems out of my league, so I'll just pretend it doesn't exist for now :)

    For the period 18/2/17 through 18/2/20, off $100k starting with no slippage, no compounding the backtest was as below.

    upload_2020-2-19_20-30-21.png
     
    fergee, Skate, debtfree and 1 other person like this.
  12. Newt

    Newt

    Posts:
    509
    Likes Received:
    768
    Joined:
    Oct 17, 2012
    How could the shorter backtest periods Qldfrog suggested/requested be so different to the returns above over 3 years? Some facts and thoughts, and background on the niche I feel my system occupies:

    - Trades full ASX universe, not just All Ords - providing conservative liquidity requirements met
    - I have a strong suspicion this is a slight edge - my trading is like my driving - I don't like to change lanes a lot but we all like to be in the lane that is moving best. Skate (and probably many others here) may be more nimble getting into All Ords trades early, but hopefully by the time a stock is in the ASX500 and trending I already have a position some time ago before it entered the All Ords universe
    - System is set up to enter after a decent trend has established - I've tried to force earlier entry criteria but they always hurt final performance
    - System is set up to hang on to trending stocks as long as possible - there certainly is no stale filter in there - but still cuts losses and tries to lock in profits with initial % stop and trailing ATR stop
    - Entry criteria requirement significant volume, new highs, trend and other conditions - net effect is my total number of trades generally much less than other active systems (100 versus almost double that for Skate's stale stop modified CAM in post 2380)
    - My ego likes to see some outlier large stocks ("multi-baggers"), and my lazy side is happy having less buy and sells to do

    A more important effect of this "fussy" trade selection into less trades is that the system takes time to assemble a full number of positions, and I consistently find in backtests 15 positions performs better than 20 or more. For the 1/1/19 to 1/1/20 backtest the system was still only 60% invested in June. Over longer periods the system will frequently hang on to trending stocks that flatline (but don't track downwards) during prolonged ASX downturns.

    The system I'm describing is probably closer to skate's "non-stale stop" CAM - chases higher returns with less trades but at cost of greater return variability (lower Sharpe, larger and longer DDs).


    So, in conclusion:
    - I was surprised (and not so surprised) at how bad backtests were on periods < 12 months
    - I don't think my system is over-optimised - I'll know for sure in 10 years or so :)
    - Annual return above (previous post) closely reflects my actual returns through 2019

    Lies, damned lies, and statistics! So much to learn from backtests, and great thread idea QF, but hopefully some of this shows how hard it can be comparing apples and oranges.
     
    qldfrog, Skate and debtfree like this.
  13. qldfrog

    qldfrog

    Posts:
    5,135
    Likes Received:
    3,990
    Joined:
    Jun 8, 2008
    I think it could be worthwhile for me to run..and share..my system on this 3y period as well
    As you Newt, my system1 takes a long time to ramp up while system2 is designed to be more dynamic.
    It will be intesting to compare these with the 3y period
     
    Skate and Newt like this.
  14. qldfrog

    qldfrog

    Posts:
    5,135
    Likes Received:
    3,990
    Joined:
    Jun 8, 2008
    18/2/17 through 18/2/20
    System 1:
    upload_2020-2-20_14-22-21.png
    System2:
    upload_2020-2-20_14-23-6.png
    123 reverse:
    upload_2020-2-20_14-23-54.png

    The surprising thing is how similar these 3 systems are whereas they have much difference on a shorter timeframe
    basically 20% annual return 25% if risk adjusted
    The own flipper zig modified still under investigation returns 63% annual with nearly 90% adjusted
    I really pray it is future leak free as this could be a winner
    I noticed in the previous one nearly 60% losers whereas I would have expected a 60% winners so that gives me so lead on how to improve
     
    Newt and Skate like this.
  15. Skate

    Skate

    Posts:
    2,007
    Likes Received:
    8,976
    Joined:
    Dec 28, 2013
    If Tomasz Janeczko, developer of AmiBroker can't code a ZigZag strategy without a future leak what hope is there for us
    Read here: http://traders.com/Documentation/FEEDbk_docs/2003/11/TradersTips/TradersTips.html#amibroker

    Future Leak Capture.PNG

    Here is the problem with the The ZigZag indicator in a nutshell
    @qldfrog the ZigZag indicator identifies pivot points but looks into the future – (beyond the right edge of the chart) in doing so "guaranteeing a future leak"

    The ZigZag function can be misleading
    The ZigZag function is one on those indicators that can be misleading because it accurately pinpoints the "Tops and Bottoms" of a stationary price range. Traders have a habit of falling in love with indicators & the ZigZag indicator is no exception. Often the technical guys will search for an indicator that will give them an edge & when traders stumble across the ZigZag indicator they believe they have just found it, as it backtests very well. (@qldfrog - most times too well).

    Reality is a bit different
    The ZigZag indicator "repaints" with the arrival of additional data. In other words, the indicator changes the most recent “Top or Bottom” in order to reflect the new price data, the previous signals are now long gone as the market moves on. Backtesting works on static data!

    Is the ZigZag indicator worthless?
    No, the ZigZag indicator isn’t worthless, far from it. The ZigZag indicator can be used quite effectively for analysing past data & creating very good setups for many strategies - just not in the way most believe. There are many ways that this indicator can be used effectively.

    It's being traded successfully
    Well done @rnr a member who has a proven tradable version of the ZigZag indicator but for me & I've tried hundreds of ways trying to overcome repainting of signals with ZERO LUCK.

    I now have a 20% Flipper with NO Future Leak
    I have a 20% Flipper Strategy coded without using a ZigZag indicator, thus no future leak

    Skate's NO Future Leak Capture.PNG

    Skate.
     
    MovingAverage, Newt, Saqeeb and 4 others like this.
  16. qldfrog

    qldfrog

    Posts:
    5,135
    Likes Received:
    3,990
    Joined:
    Jun 8, 2008
    understood ,
    but :)
    if you consider the let's say last n bars, you can find the zigzag point up to that point in time, easy
    this gives you a list of candidates, you can select some
    then when the next bar comes next week, sure the zigzap might recompute and a previous low may not be a low anymore but this is where your exit criteria can play for you to eliminate candidates
    The issue is: it is hard/(impossible in AB?) to backtest : you would need a kind of "progressive/incremental backtest engine", bar by bar
    Between some hacks for the graphic part, help from @rnr and own tweaking, I think I might be on something;
    I am paper trading it and weekly check that the previous weeks explore results are preserved.
    so far so good
    I will try to move the same code on a daily timeset to speed the future leak check
    Anyway, looking for the philosopher's stone is what brought modern chemistry, we all need a holy grail
    And as discussed I need a bit of paper trading before committing money there
     
    Skate likes this.
  17. Warr87

    Warr87

    Posts:
    354
    Likes Received:
    666
    Joined:
    Jun 28, 2019
    My CAM system:

    6 month down

    upload_2020-2-20_19-42-33.png

    6 month up

    upload_2020-2-20_19-44-15.png

    full year
    upload_2020-2-20_19-45-49.png


    My MAP system


    6 month down
    upload_2020-2-20_19-47-25.png

    6 month up
    upload_2020-2-20_19-48-49.png

    1 year
    upload_2020-2-20_19-49-44.png


    My super trend strat (tested on weekly but paper trading monthly right now)

    6 month down
    upload_2020-2-20_19-52-14.png

    6 month up

    upload_2020-2-20_19-53-19.png

    1 year

    upload_2020-2-20_19-54-30.png


    An EMA system that I developed by haven't really played around with. Will fine tune later. No name for this system yet either, for the moment I will call it my EMA/ADX system

    6 month down
    upload_2020-2-20_19-58-9.png

    6 month up

    upload_2020-2-20_19-59-18.png

    1 year

    upload_2020-2-20_20-0-6.png
     
    qldfrog, Newt, Saqeeb and 1 other person like this.
  18. Warr87

    Warr87

    Posts:
    354
    Likes Received:
    666
    Joined:
    Jun 28, 2019
    I ran my EMA ADX system against a few different time frames. It does have an average of 60-70% in a few time frames but seems to be dependent on the market trend.

    I also don't know how everyone was able to print screen all of the results for backtests. Shame there isn't an easy export option for the backtest reports.
     
    qldfrog likes this.
Loading...

Share This Page