Bayes Theorem & Share Trading on the ASX

33
A New Technical Indicator and its Probability of Being Useful Ian Aberdeen Retired agricultural scientist Fellow of the Australian Institute of Agricultural Science 30+ years share trading Creator of The A-Line Market Index Iain McLean BSc Eng GradDipPsych Fenestration Engineer UK, EU & USA

Transcript of Bayes Theorem & Share Trading on the ASX

Page 1: Bayes Theorem & Share Trading on the ASX

A New Technical Indicator and its Probability of Being Useful

Ian Aberdeen Retired agricultural scientist

Fellow of the Australian Institute of Agricultural Science 30+ years share trading

Creator of The A-Line Market Index

Iain McLean BSc Eng GradDipPsych

Fenestration Engineer UK, EU & USA

Page 2: Bayes Theorem & Share Trading on the ASX

The A-Line Market Index The A-Line Market Index is a leading indicator that predicts trend developments and reversals in the Australian stock market. A proprietary algorithm creates a quantified reading of market mood. The resultant data is used to create the A-Line Market Index.

Page 3: Bayes Theorem & Share Trading on the ASX

The A-Line Market Index

Page 4: Bayes Theorem & Share Trading on the ASX

The Scientific Method The classic method originated with Aristotle and was refined by Galileo before Rene Descartes established the modern method which allows for heuristics to harness chance, which in turn leads to discovery. Heuristics Definition:

“Exploratory problem-solving techniques that utilise self-education techniques (as the evaluation of feedback) to improve performance.” -Oxford Dictionary

Page 5: Bayes Theorem & Share Trading on the ASX

Probability What is probability? Definition:

“The extent to which an event is likely to occur, measured by the ratio of the favourable cases to the whole number of cases possible.” -Oxford Dictionary

Page 6: Bayes Theorem & Share Trading on the ASX

XAO & The A-Line

Page 7: Bayes Theorem & Share Trading on the ASX

The A-Line Newsletter

Page 8: Bayes Theorem & Share Trading on the ASX

The Signal & The Noise “Most statistical models are built on the notion that there are independent and dependant variables, inputs and outputs, and they can be kept pretty much separate from one another. When it comes to the economy, they are all lumped together in one hot mess.”

-Nate Silver

Page 9: Bayes Theorem & Share Trading on the ASX

Sir Ronald A. Fisher FRS

1919 Began using statistics for agricultural research & design.

1925 Pub: Statistical Methods for Research Workers.

1929 Fellow of The Royal Society.

1933 Galton Professor of Eugenics at University College, London.

1957 Emigrated to Australia. Senior Research Fellow at CSIRO.

(1890-1962)

Page 10: Bayes Theorem & Share Trading on the ASX

Experimental Design Fisher pioneered the use of the term ‘variance’ in statistics & experimental design to eliminate variance.

His work gave the modern scientific method, developed in the 17th century, a new level of power in that experiments were mathematically analysed and could be peer-reviewed.

Page 11: Bayes Theorem & Share Trading on the ASX

Statistical Significance When Fisher developed ANOVA he created the notion of a 5% probability level commonly called the alpha (α) level - the probability of making a false positive decision. In essence: If we run an ANOVA and find <5% probability that the result is attributable to the null hypothesis (H0) we describe the result as statistically significant and supporting of our hypothesis (H1).

Page 12: Bayes Theorem & Share Trading on the ASX

Dr Helen Turner AO OBE (1908 -1995)

Australian geneticist – sheep breeding & wool production. 1931 Clerical then Technical Officer / Statistician at CSIRO.

1956 Senior Research Scientist (genetics) at CSIRO.

Page 13: Bayes Theorem & Share Trading on the ASX

Thomas Bayes (1701-1761)

English statistician, philosopher & Presbyterian minister. 1736 Pub: Introduction to the Doctrine of Fluxions defending Newton’s calculus. 1743 Fellow of the Royal Society.

1763 Pub: An Essay towards solving a Problem in the Doctorine of Chances.

Page 14: Bayes Theorem & Share Trading on the ASX

Bayesian probability is used today in science, engineering, law, psychology and medicine to strengthen the case as more evidence is acquired. We learn about the universe through approximation, getting closer to the truth as we get more evidence.

Bayes’ Theorem

Page 15: Bayes Theorem & Share Trading on the ASX

Does The A-Line leave you holding shares when the XAO is in downtrend? Our instinct is ‘YES’ because: a) It predicted the GFC and stayed depressed throughout the following dead cat bounce. and b) It became prosperous prior to the XAO upturn in 2009.

Research Question

Page 16: Bayes Theorem & Share Trading on the ASX

Gather Data XAO & A-Line weekly charts. 5 & 10 period EMA’s crossings to show trends. Hypothesis Test Support / refute the hypothesis: The A-Line doe not leave you holding shares in a bear market.

Method

Page 17: Bayes Theorem & Share Trading on the ASX

Samples & Populations A normally-distributed population

Page 18: Bayes Theorem & Share Trading on the ASX

Samples & Populations A normally-distributed population & sample. Inferences on sample will reflect the population.

Page 19: Bayes Theorem & Share Trading on the ASX

Samples & Populations Normally-distributed population & biased samples Inferences on biased samples will skew results

Page 20: Bayes Theorem & Share Trading on the ASX

The Data Weekly charts: Trends confirmed with 5 & 30 period EMA’s

This is our population – all the available data.

Page 21: Bayes Theorem & Share Trading on the ASX

What hypothesis test is most suitable for the A-Line data?

Data structure = correlational Data type = quantitative discrete

Measurement level = ordinal

Pearson’s r: Data type will only give Phi Coefficient Phi-Coefficient: Already verified by visual check on data Spearman’s rho: Already verified by visual check on data Bayes’ Theorem

Hypothesis Testing

Page 22: Bayes Theorem & Share Trading on the ASX

Takes a prior probability and re-evaluates it using new evidence to provide a revised probability. “Bayes’ theorem is to the theory of probability what Pythagoras’s theorem is to geometry.”

-Sir Harold Jeffreys FRS

Bayes’ Theorem

Page 23: Bayes Theorem & Share Trading on the ASX

Bayesian Convergence

Page 24: Bayes Theorem & Share Trading on the ASX

Extended form

Pr = Revised / Posterior Probability = Prior Probability. 5% - Very low. Initial estimate of how likely an A-Line event predicts a market trend reversal. = Probability hypothesis (H1) is true.

50% - Boolean. ‘Yes’ or ‘no’. The A-Line keeps us in or takes us out of the market.

= Probability null hypothesis (H0) is true. 20% - Very high. Raw data or data entry error.

Bayes’ Theorem

Page 25: Bayes Theorem & Share Trading on the ASX

Event Definition An event is when the A-Line signals a depression and moves to take profit when the XAO turns down: From the chart above we see there is a positive relationship but we want to quantify the probability of that relationship continuing to protect our capital.

Page 26: Bayes Theorem & Share Trading on the ASX

Starting out with a very low expectation (5%) we return a probability of 11.63% doubling our expectations for future events being profitable.

It is not statistically significant but we can use this revised probability as our prior for the next event.

First Event

Page 27: Bayes Theorem & Share Trading on the ASX

Within 6 events the probability of the A-Line protecting capital is 92.43%.

6-Event Analysis

Page 28: Bayes Theorem & Share Trading on the ASX

XAO Retracements There are 6 events when both XAO & A-Line turn down. There are also an additional 2 depressions in the A-Line during significant XAO corrections in 2004 & 2006.

Page 29: Bayes Theorem & Share Trading on the ASX

XAO Retracements

All Ordinaries (2006) with 5 & 30 EMA’s

Page 30: Bayes Theorem & Share Trading on the ASX

By the 7th event the probability of the A-Line protecting capital is 96.64% - statistically significant under Fisher’s 5% alpha level criterion.

8-Event Analysis

Page 31: Bayes Theorem & Share Trading on the ASX

Changing the values to: = 5% initial estimate probability = 33% chance H1 is true = 35% chance H0 is true There is no statistical significance.

Alternatively…

Page 32: Bayes Theorem & Share Trading on the ASX

High Probability Trades Whenever a high probability strategy is presented always look at the back tested data. If none is provided then consider that strategy as untested.

“If you can’t make money from unleveraged intermediate term trades using weekly and daily data, you are going to get cleaned out fast making short-term trades with highly leveraged markets.”

-Robert Miner High Probability Trading Strategies

Page 33: Bayes Theorem & Share Trading on the ASX

Conclusion Using Bayesian inference there is a statistically significant positive relationship between A-Line signals and Australian stock market trend reversals

There is a high probability that A-Line will protect capital by signalling future depressions in the Australian stock market.

No indicator can predict the future with 100% accuracy but data analysis can isolate trends for profit.

Knowing when the trend begins is not as important as knowing when the trend is ending.