Australian (ASX) Stock Market Forum

Trading System by Andrew Gibbs - Member of Larry Williams Hall of Fame

To deal with survivorship bias, why don't u run a backtest on say S&P100 constituents from late 2000 - see attached.

View attachment 54839

Have S&P 500 constituents too back to 1990.

^^ This is the obvious solution. Doing this will put an end to the arguments and show us how significant survivorship bias is. Overlay the first equity curve with the survivorship-free equity curve, so we can get a quick visual.
 
Thanks Skyquake and Gringgotts, I'll set this up and post the results. Nullanulla I can probably do the ASX property trusts as well. If Trade Navigator has the data the tests can be run.

ZZ..
 
Results as follows on a stock by stock basis where Trade Navigator supplies the data. Other software like Multicharts or Amibroker that accepts third party data would need to be used for testing those stocks that do not exist anymore. Results 2000 onwards.

SP100 2000.png

Next Page

SP100 2000 p2.png
 
If it helps, perhaps you could reduce the back test to the following extract from the property sector:

Share Code
Abacus Property ABP
Australand Property ALZ
BWP Trust BWP
Challenger Div CDI
CFS Retail Trust CFX
Charter Hall CHC
Charter Hall Retail CQR
Commonwealth_Office CPA
Cromwell CMW
Dexus DXS
Federation Centres FDC
FKP Stapled FKP
Goodman Group GMG
GPT Group GPT
Investa Office IOF
Mirvac Group MGR
SCA Property Group SCP
Stockland Property SGP
Westfield WDC
Westfield Retail WRT

From January 2009 to September 2013 and $10,000.00 trades.
 
If it helps, perhaps you could reduce the back test to the following extract from the property sector:

Share Code
Abacus Property ABP
Australand Property ALZ
BWP Trust BWP
Challenger Div CDI
CFS Retail Trust CFX
Charter Hall CHC
Charter Hall Retail CQR
Commonwealth_Office CPA
Cromwell CMW
Dexus DXS
Federation Centres FDC
FKP Stapled FKP
Goodman Group GMG
GPT Group GPT
Investa Office IOF
Mirvac Group MGR
SCA Property Group SCP
Stockland Property SGP
Westfield WDC
Westfield Retail WRT

From January 2009 to September 2013 and $10,000.00 trades.

Results attached, Jan 09 to early 2013.

Code used:

SetOption( "InitialEquity", 200000 );
SetOption( "commissionmode", 2 );
SetOption( "CommissionAmount", 30 ) ; // make 5
SetOption( "allowsamebarexit", False) ;

SetTradeDelays( 1, 1, 1, 1 ) ;


Buy_Cond1 = C < SAR(0.01,0.2) AND RSI(4) < 25 ;

Buy_Cond2 = Ref(C < SAR(0.01,0.2), -1) AND Ref(H,-1) > Ref(HHV(H,15),-2) ;

Buy = buy_cond1 OR buy_cond2 ;

BuyPrice = O ; // IIf(Cond1, O, HHV(H,15)) ; //AND Ref(intrade_L,-1) == 0 ;

Sell_Cond1 = Ref(SAR(0.01,0.2) < C, -1 ) AND C < SAR(0.01,0.2 ) ;

Sell_Cond2 = Foreign ("XJO","Close") < Ref( Foreign ("XJO","Close"),-100) AND C < SAR(0.01,0.2 ) ;

Sell = Sell_cond1 OR Sell_cond2 ;

SellPrice = O ;


SetPositionSize( 10000, spsValue );

Not sure if the proposed ticker set qualifies as a "123" group, whose population will change over a period of time.
 

Attachments

  • psect williams v1.JPG
    psect williams v1.JPG
    63.4 KB · Views: 16
Yikes caveroute that's one ugly equity curve.

Can you also run it on the S&P500 stocks please? (with the earlier constituent list that Skyquake provided).
 
Still waiting for a backtest from which even remotely useful conclusions can be drawn...

Not much point of the OP backtest against the S&P100 constituents from 2000 with only the survivors included. I can't be bothered counting out the rows of the chart, how many stocks are even tested?

Since AFL code has been posted, I'll also add that Frank Hassler from Engineering Returns is offering his AFL survivorship code (data not included, PremiumData recommended) originally for a $500 UNICEF donation but I think these days you just have to email him (second link)

http://engineering-returns.com/2010/09/02/the-impact-of-survivorship-free-backtesting/
http://engineering-returns.com/2011/02/07/test-your-trading-strategies-survivorship-free/
 
How can you have a survivorship code if your data doesn't hold the stock
IE it's delisted or had it's name changed.---
Are you saying Premium data have all of these going back 30 yrs
 
Technical System on ASX Property Trusts. From 2005 to now.

View attachment 54873

Hi ZZ

Thank you for the effort. Unfortunately if you include the period from November 2007 to January 2009, the outcome will be a disaster because this is when the world woke up to the level of leverage A-REIT's were using and the massive sell down that resulted throughout 2008. If it isn't too much trouble, it would be much appreciated if you could narrow the backtest down for the same shares as per your list for the period of January 2009 to September 2013. This was when most of the A-REIT's restructured, refinance and reduced their debt to arround 30% +/-.

If you could produce a summary table, per your earlier posts re the S&P200, as well it would be much appreciated.
 
How can you have a survivorship code if your data doesn't hold the stock
IE it's delisted or had it's name changed.---
Are you saying Premium data have all of these going back 30 yrs

Is this a serious question? Yes, you need the data. The code handles the data.
 
Is this a serious question? Yes, you need the data. The code handles the data.

Yeh its serious.
I was un aware that Premium data had the product which I believe has only been out about 18 mths.
 
The survivorship bias issue is handled from the stock selection side as I've already mentioned. The system is just a way to enter and exit the market. My mistake with this thread was putting the cart before the horse, should have started with stock selection then moved on to entry and exit rules using technical analysis.

The success or failure of the entire method depends almost entirely on stock selection.

The main point of the backtests was to find a generic method that we could apply to the stocks we choose from our screening method that would make money, assuming the screening method isolates stocks that are likely to outperform the index.

To be exact with the testing and historical hypothetical performance we'd need to run a back test on the screening technique first so we have a list of stock and the dates upon which they entered and exited the basket historically and then backtest the technical system on the evolving basket over the historical period.

For most of us and for the average person it is to time consuming and beyond most peoples skill level so I've made a number of assumptions and taken some short cuts.

1. By testing on a wide range of stocks we can safely conclude that the technical system is profitable on stocks with an upward bias. It is an appropriate method where the same rules can be applied to each and every stock that enters our stock trading basket There were 251,000 trades in the Russell3000 test and 18,000 trades on the S&P100. Yes the stocks have an upward survivorship bias but I'm ok with that as I am handling this problem from a different angle.

2. I showed the quick and easy way to pick stocks that are likely to outperform the market, it takes out the time consuming part of building your own custom stock selection method in Portfolio123, learning the software and back-testing the screening criteria and taking advantage of other peoples expertise.

3. By combining the stock selection from the stock baskets used in the Ready2Go models in P123 with a technical system that makes money from stock showing an upward bias we should have a method that makes money in the future.

I think it is pretty safe to conclude that this entire method has a good chance of making money.

Personally, with my trading hat on, that is what I care about....

We haven't even touched upon risk management yet and I've only briefly discussed the stock selection methods so there is still plenty to talk about.
 
ASX Real Estate 09 to now... again please refer to my previous post...

ASX Property Trusts.png

and equity curve

ASX Real estae Eq Curve.png


Perhaps with future posts I can create a custom stock screen or portfolio in portfolio123 then what I can do is test on those constituents over the historical period, maybe with an annual re-weighting to save time for a more accurate historical performance on that particular stock basket... that will take a lot of time however but it will show whether additional alpha is generated from the entry and exit rules.
 
The survivorship bias issue is handled from the stock selection side as I've already mentioned. The system is just a way to enter and exit the market. My mistake with this thread was putting the cart before the horse, should have started with stock selection then moved on to entry and exit rules using technical analysis.

The success or failure of the entire method depends almost entirely on stock selection.

The main point of the backtests was to find a generic method that we could apply to the stocks we choose from our screening method that would make money, assuming the screening method isolates stocks that are likely to outperform the index.

To be exact with the testing and historical hypothetical performance we'd need to run a back test on the screening technique first so we have a list of stock and the dates upon which they entered and exited the basket historically and then backtest the technical system on the evolving basket over the historical period.

For most of us and for the average person it is to time consuming and beyond most peoples skill level so I've made a number of assumptions and taken some short cuts.

1. By testing on a wide range of stocks we can safely conclude that the technical system is profitable on stocks with an upward bias. It is an appropriate method where the same rules can be applied to each and every stock that enters our stock trading basket There were 251,000 trades in the Russell3000 test and 18,000 trades on the S&P100. Yes the stocks have an upward survivorship bias but I'm ok with that as I am handling this problem from a different angle.

2. I showed the quick and easy way to pick stocks that are likely to outperform the market, it takes out the time consuming part of building your own custom stock selection method in Portfolio123, learning the software and back-testing the screening criteria and taking advantage of other peoples expertise.

3. By combining the stock selection from the stock baskets used in the Ready2Go models in P123 with a technical system that makes money from stock showing an upward bias we should have a method that makes money in the future.

I think it is pretty safe to conclude that this entire method has a good chance of making money.

Personally, with my trading hat on, that is what I care about....

We haven't even touched upon risk management yet and I've only briefly discussed the stock selection methods so there is still plenty to talk about.

To be exact with the testing and historical hypothetical performance we'd need to run a back test on the screening technique first so we have a list of stock and the dates upon which they entered and exited the basket we going to be trading and then backtest the technical system on the evolving basket over time.

Precisely.

If you can give me an excel/csv file in this format:
Ticker, Date, O,H,L C, Rank
Where rank is used to represent the most favourable precedence in the basket.
So, if we have 10 tickers, with 250 days per year, for 3 years, that represents 10*250*3 rows per ticker. Rows within a ranking window will have the same rank value, once we have performed a ranking assessment they are modified thru to the next window. So, if we have 12 months of data and rank weekly, there will be 52 different ranking groups.
To do this export whatever data source you have into excel and somehow add the rank value.
Then I can:
Load the data into a new AB database
Use rank to drive the AB position score algorithim - which means I add one line in my code and AB will buy based upon available capital, position size and highest rank.
Generate results based on ranking changes within the basket
Let any inflight trades die a natural death according to the rules we already have.

I think this will work, but you never know until you try.
 
To be exact with the testing and historical hypothetical performance we'd need to run a back test on the screening technique first so we have a list of stock and the dates upon which they entered and exited the basket historically and then backtest the technical system on the evolving basket over the historical period.

YEP and then you need to compare against just holding the stocks and see if the trading overlay (after slippage, transaction costs, dividends and tax implications) adds any extra return.

Until you prove the overlay adds value with a robust comparison, the prudent assumption (and my expectation) is that it doesn’t add any value.

A simpler way to test the overlay may to be take the strongest 10 stocks that have remained in the S&P 100 over the last 10 years and compare the overlay against just holding outright. The selection would be based on hindsight of strength but that doesn’t matter because you are just trying to isolate if the overlay adds value to a buy and hold based on another system that targets strong stocks.

Not sure why though we are so bogged down on a trading overlay when you are indicating that the majority of the result is due to stock selection. You obviously want to plug portfolio123 here for that job, so I reckon sling a few advertising bucks to the appropriate person and spruik your hart out. I’m interested in hearing the nitty gritty of what it has to offer but am not motivated to take the trial yet. (specifically interested in how much of the underlying data for conducting the fundamental system tests is visible and could be scrapped to excel etc)
 
ASX Real Estate 09 to now... again please refer to my previous post...

View attachment 54896

and equity curve

View attachment 54897


Perhaps with future posts I can create a custom stock screen or portfolio in portfolio123 then what I can do is test on those constituents over the historical period, maybe with an annual re-weighting to save time for a more accurate historical performance on that particular stock basket... that will take a lot of time however but it will show whether additional alpha is generated from the entry and exit rules.

Thank you for the above.

1. In regard "concurrent trades" does the back test identify all the possible trades across the nominated shares or is there a first come first entered criteria determined by the remaining funds in your trading pool?

2. Does the program record the time the trade runs for (number of days) and can the program determine the average holding time across all trades?

3. Can the back test program extract a list of trades per individual share (entry/exit dates, entry/exit price etc).

4. Does the back test program factor in the entitlement to distributions/dividends in the result? Where a trade is active through the period where a stock goes ex-div, although the stock going exdiv would probably trigger a stoploss sell on the exdiv date the investor would still be entitled to the div?

thanks & regards

nulla
 
1. In regard "concurrent trades" does the back test identify all the possible trades across the nominated shares or is there a first come first entered criteria determined by the remaining funds in your trading pool?

The backtest takes all possible trades with $10k allocated to each trade, you could potentially be in every stock on the list at the same time.

2. Does the program record the time the trade runs for (number of days) and can the program determine the average holding time across all trades?

Yes, see below:

ASX Property Stocks trades screenshot.png

Pm me and I can send a txt file of every trade.

3. Can the back test program extract a list of trades per individual share (entry/exit dates, entry/exit price etc).

Yes, see above.

4. Does the back test program factor in the entitlement to distributions/dividends in the result? Where a trade is active through the period where a stock goes ex-div, although the stock going exdiv would probably trigger a stoploss sell on the exdiv date the investor would still be entitled to the div?

No dividends are included with the tests in Trade Navigator.

p.s. ignore the label of the entry in the table above, it is not accurate and has nothing to do with bollinger bands...
 
No dividends are included with the tests in Trade Navigator.

Yeah I guess if you're going to produce an invalid backtest, you might as well go the whole hog and use the least useful data you can get to really muddy those waters.

Not sure why though we are so bogged down on a trading overlay when you are indicating that the majority of the result is due to stock selection.

The fact is that OP has explained away the part of the system he claims provides alpha through the Portfolio123 "black box". Anyone who wants to contend that fundamental factors add alpha can go and read all the papers on SSRN or even download the free Fama+French datasets to perform their own analysis.

So have we gotten bogged down in the overlay or is it the only thing being discussed because it's actually the only thing OP has provided insight into? So far the thread has gone something like this:

OP: Hey! Awesome! Stats!
Me: Those stats are rubbish and cannot certainly be used to verify Awesome.
OP: No they aren't! Because, black box.
*repeat*

You obviously want to plug portfolio123 here for that job, so I reckon sling a few advertising bucks to the appropriate person and spruik your hart out. I’m interested in hearing the nitty gritty of what it has to offer but am not motivated to take the trial yet. (specifically interested in how much of the underlying data for conducting the fundamental system tests is visible and could be scrapped to excel etc)

There is a great book out there "Quantitative Value", I paid about $50 on Amazon for it, full nitty gritty on the strategy the guys who wrote it run their fund with. There is a free website (http://alpha.turnkeyanalyst.com) for their screener (along with a couple of extra quantitative screens and forecast tools thrown in) with backtest data (including Fama French factor backtests) going to 1970, built on CompuStat data. If you've read that book, use their website and read say, Mebane Fabers seminal paper on the 200 day SMA trading rule (free on SSRN or on his website) or similar papers on "Absolute Momentum" then you are at least on par if not far far ahead of what P123 could possibly offer.

EDIT: If you don't want to buy the book, almost every section of it was originally posted as blogposts on greenbackd.com
 
There is a great book out there "Quantitative Value", I paid about $50 on Amazon for it, full nitty gritty on the strategy the guys who wrote it run their fund with. There is a free website (http://alpha.turnkeyanalyst.com) for their screener (along with a couple of extra quantitative screens and forecast tools thrown in) with backtest data (including Fama French factor backtests) going to 1970, built on CompuStat data. If you've read that book, use their website and read say, Mebane Fabers seminal paper on the 200 day SMA trading rule (free on SSRN or on his website) or similar papers on "Absolute Momentum" then you are at least on par if not far far ahead of what P123 could possibly offer.

EDIT: If you don't want to buy the book, almost every section of it was originally posted as blogposts on greenbackd.com


Sinner

Thanks for the lnfo/limks however the turnkey link just goes to a login screen.

I’m thinking, If P123 is white label access to CompuStat data then it could be useful. All depends on whether the data required for the back testing is visible/accessible or not. Waiting on ZZ to clarify. To date I’ve only found decent historical fundamental data in expensive institutional platforms.
 
Top