[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: OT: Statistics



PureBytes Links

Trading Reference Links

Thanks to the forum for allowing me some *room to move* to discuss 
Trading Philosophy and Psychology.
I'll try not to abuse the privilige.

We can't be one person outside the trading room and someone else 
inside.
First-class traders are almost certainly first-class people in life, 
albeit in their own way.

********************************************************************

For Dimitris, the *Maestro of Generosity*; you shamed me into a 
generous act.
For every other generous contributor to the AmiBroker community; 
past and present.
For all who posted in this topic; you gave of yourselves.
For Tomasz who started it all and sustains it by his breath; *a 
creative bubble in the Universal Flux*.

For the forum.

********************************************************************

Bill,

An insightful question.

You asked for it!

I'll reverse the order this post and provide the *waffle* first.
Hard-nosed rationalists just scroll down; your bits either at the 
bottom or coming in another post.
(I'm starting to get bored with myself so the Psychology of Trading 
series will end in this session).

My wife is a piano teacher and sometimes we discuss the philosophy 
of teaching.
I provided her with a visual mnemonic to help her focus on the 
essential pedagogical path.
 I call it the *Triangle of Success*.
At each point of the triangle either of the words, THEORY, PRACTISE 
OR PERFORMANCE is inscribed (outside the triangle so that the peaks 
point  at the words). 
Performance is at the apex.
In the centre a circle that touches each side of the triangle once 
is drawn and it has a single arrow head pointing anti-clockwise to 
indicate circular motion (progress).
The arrow head is in the bottom left section.
Symbologists would recognise the circle as Erebus; eternity or 
perpetuality.
The white space within and without the shape isnot(Null).
It is the *co-joined twins* (a triplicity in truth) or the *dual 
zeros*; the special case of zero signed in maths as infinity.
In its primal form whitespace (the quantum state?)  is energy and 
chaos.

In modern culture, especially business culture, we would recognise 
the concept that the mnemonic encapsulates as continuous improvement.
Continuous improvement is achieved by the repetitive cycle of 
theory, followed by practise followed by performance, which is the 
*testing ground*, also known in my school as the *burning ground*.
The testing ground is the place where the inflated ego is sloughed 
off under the onslaught of reality (trading) and back to the drawing 
boards we go.

For specific applications a small cross is inscribed in the centre 
of the circle to stand for any specific objective (trading goal?).
This represents the fact that we progress by binding theory, 
practise and performance to a specific and particular goal.
The cross symbolizes that unbounded chaos is drawn from the four 
quarters and focused at the central (objective) point.

Unlike academic study, progress on *The Path of Success* is not 
linear or consistent.
Development is a circular procession around the goal 
(circuambulation).
Often quantum leaps in progress are experienced, usually at the 
least expected point in time.

Of course the specific goal is not written within the circle, it is 
emblazoned within our SELF.

How do we use this?

Anyone who can't see the uses for it doesn't need it.

Admonition!

Money is not wealth.
Money is a tool.
Use it to help yourself, your family and loved ones, friends, 
neighbours, community, the nation and the world.
Then right will be on your side and *right is might*.

Be generous with what, as traders, we earn so easily; don't cast 
your pearls before swine though.
That is the price we pay for having so much fun while most other 
people have to work for a living.

Anyone who is interested in following up on the topic should 
maintain a reading list from amongst the plethora of personal 
development material available.
Anything from Tony Robbins to the spiritual texts or religious 
scriptures is of inestimable benefit in attaining self-knowledge and 
hence self-discipline.

Two of my favourites are the late great novelist Carlos Casteneda 
and also the late Psychologist Carl Jung; one of the greatest human 
beings of the last 100 years in my book.

They are definitely not everyones cup of tea and people should 
choose their own favourites.

Beware of fakirs though.
The foothills surrounding *Mt Olympus* abound with them.

****************************************************************

The *calender effect* and general comments.


The calender effect is old hat.
I assumed every trader in the forum who was interested in exploiting 
it had already done so or abandoned it as not profitable.
It hasn't been near the top of my lists so I haven't had a go at it 
before, but, any specific market behaviour that is significant with 
99.9% confidence levels is worth investigating in my book.
Of course it is only viable as a trade if large enough movement is 
also there.

I realise the older hands are only interested in a winning system, 
if at all, although my work nearly always contains a sprinkling of 
original material or old material presented in new ways.
I have provided some commentary for the benefit of newcomers that is 
mainly straight out of the textbooks.

Perhaps we can manage to squeeze a new tune from an old fiddle.

Keep in mind that a lot of tested hypotheses don't get a pass mark, 
so the odds are against finding a winning system on any single 
*project*.

I should also acknowledge the work of Arthur A Merrill once again; 
his efforts were an outstanding achievement at the time that he 
wrote.
I'm drawing from his work, which is readily available in print, 
although I had already formed an opinion on calender cycles long 
before receiving confirmation from other analysts.

General theories on market behaviour act as a creative stimulus to 
our trading and are a good starting point.
Technically speaking, as Fred says, the why is not as important as 
the when and the what.
However, as Sebastian has pointed out, starting with a why is a more 
fruitful approach than blindly crunching numbers, although the 
Freddites might find ways to climb all over me on that one.

We can hold many general theories of market behaviour.
They are not absolutes; only relatives.
They need not be true and any or all arguments they contain need not 
be true.
We can in fact hold contrary market theories all at the same time.
The proof of the pudding is in the eating.
Different theories evolve different trading systems that 
collectively comprise different trading styles.
 Trading different systems and/or different markets is the freelance 
traders equivalent of diversification (once applied with 
sophistication).
A master trader can move between styles with aplomb.


*********************************************************************

Discussion of a possible *Calender Effect* (CE) trading system.

1. Approximate *textbook* process flow:

General theory of the market  > specific theory (model) of the 
market > hypothesis  > test the hypothesis > list all possible 
trading systems derivable from the hypothesis  (still allow creative 
thinking  at this stage) > test all possible  systems (objective 
process commences) > optimise all or only the most promising systems 
> statistically evaluate top model(s) (100% objective filter) > out 
of sample testing of top model(s)> trade system > evaluate intitial 
trading performance > add system to a balanced portfolio (freelance 
style portfolio).

It's a near certainty that  I will only walk CE through the initial 
steps.

2. General theory of the markets No1 (includes additional points to 
my previous post).

The behaviour of markets in the major western cultures is similar
(USA, Australia, UK & others?)
( I don't comment on other markets because I haven't lived in those
countries and don't understand the psyche the way I understand the
psyche of the above group. That doesn't place any relative value
judgement on other cultures).

The markets are moved by institutional investors who control the
major portion of the money.
Institutional behaviour has characteristics that can be utilised by
freelance traders.
Institutional investors are people and will exhibit some behaviours
typical of people in general.
Based on personal observation of institutions, people and people in
institutions I expect markets to exhibit some of the following
behaviours to some extent:

Institutions have budget and report cycles (weekly, monthly, 
quarterly, yearly?)
Institutions are bound by rules of governance and obligations.
It is not in the interests of institutional players to stick their
heads up out of the trench.
Institutions set employees targets which are benchmarked against
industry norms.
People have short memories.
People *work* from Mon ? Fri, 9-5.
People get Mondayitis and Fridayitis.

American markets have high levels of insitutional participation.
American equities have high liquidity (frequency) so they readily 
approach statistical validity for the institutional rule.
The headline market indices are logically invalid but emotionally 
meaningful to investors (they are on prime TV every night of the 
week).

There are many more similar observations.
I have only provided a few as examples.

3. A specific market theory.

(a) For American equities, with high liquidity, a calender effect 
will be readily observable and consistent .

(b) The daily bar is the primary and natural time cycle of the 
American equity market(s).
Intraday and weekly bars are the natural micro and macro cycles. 

3.  Hypotheses

NORTH AMERICAN EQUITY MARKETS WILL HAVE A SIGNIFICANT BEARISH BIAS 
FROM THE CLOSE ON FRIDAYS TO THE CLOSE ON MONDAYS.

NORTH AMERICAN EQUITY MARKETS WILL HAVE A SIGNIFICANT BULLISH BIAS 
FROM THE CLOSE OF TRADING ON MONDAY TO THE CLOSE OF TRADING ON 
FRIDAY.

(At this stage there is no need to over state the hypothesis as 
there is plenty of scope during design and optimisation to test as 
many alternatives as we can think of and have 
the patience for. No attempt is made to formalise the process 
according to mathematical norms. It also provides me with an easy 
escape route from a probably well deserved pummelling from the 
mathematicians).

4. Test the hypothesis.

>From the work of Merrill and Colby and others:

Mondays are bearish with statistical significance.
Fridays are bullish with statistical significance.
Intraday trends measured on a half-hourly basis have a bias with the 
open more likely to  be bullish than the close.
The Monday close is the most bearish close of the week.

The caveat is that IT may have changed the nature of the markets and 
the calender effect may not survive. The data set available ex the 
IT revolution, say 1995, approaches the limits of statistical 
validity for Mondayitis i.e. 12 years x 50 Mondays = = approx 600.
Divided in two for design/optimisation plus out of sample testing 
this  is not sufficient data for my liking  so some older data will 
have to be accepted into the set.

5. List all possible trading systems that can be derived from the 
hypothesis.

In this case study I will only provide two, at least for the moment 
anyway.

SELL A MARKET (INDEX) AT THE CLOSE ON FRIDAY AND COVER AT THE CLOSE 
ON MONDAY.

BUY A MARKET (INDEX) AT THE CLOSE ON MONDAY AND SELL AT THE CLOSE ON 
FRIDAY

This suggests that the combined trade, bearish on an index over the 
weekend and bullish on an index Tues-Fri could make an effective 
trade.
In the combined trade the traders capital would be invested 100% of 
the time rather than being idle on weekends i.e. 2/7 of the time.

Colby, in fact, proposes and *tests* the Mon ? Fri bullish trade, 
using MetaStock software.
The stock selected by Colby as the vehicle for this trade is the 
DJIA.
Colby's results indicate his system *beats the market*.

*********************************************************************

Commentary on the proposed trades.

The weekend bearish trade would have less movement than the Mon-Fri 
bullish trade.
Depending on the commission paid by individual traders it is likely 
to be susceptible to *profits* being eaten up by transaction costs.

Both trades are liesurely trades, as they buy and sell the close.
For that reason slippage is likely to have minimum or little effect 
on outcomes.
Trading the indexes provides good liquidity, consistency and ease of 
processing e.g. data is readily available and there are no null data 
values to deal with.
Membership survival of index data that travels back into the distant 
past is an issue however.

If initial testing justifies further effort other potential trades 
can be considered:

Do individual stocks piggy back the CE trends?
If so can a determining factor be isolated for the group of stocks 
that out perform the CE of the index to which they belong?
What effect will leverage have on profitability?
Will indexes with high institutional participation perform 
differently to others?
Is the CE effect, as defined in the hypotheses, biased further by 
the preceeding weekly/daily/intraday trends?

Opportunities for optimisation can also be considered at a later 
stage:

Will finessing the entry and exit times improve performance?
Will indexes with higher volatility perform better?

*************************************************************

Initial testing (provisional draft ? subject to change).

Step1. Test the hypotheses.

Attempt to duplicate the results of  Merrill and Corby in various 
indexes, including obtaining some preliminary metrics e.g.

Typical % gain/loss and number of rises/falls for weekly periods.
Typical % gain/loss and number of rises/falls for weekend and Mon ? 
Fri periods.

The aim is to obtain sufficient data to estimate Chi-squared 
significance for both hypothetical patterns in a range of markets 
and also the likely range of profit or loss for a trade based on the 
fundamental hypothetical trade(s). 

********************************************************************

Anyone who wants to join in publically or privately feel free.

Use at your own risk, it may contain errors.

Likely to be continued.


BrianB2......=8-)




--- In amibroker@xxxxxxxxxxxxxxx, "brian.z123" <brian.z123@xxx> 
wrote:
>
> Hypothesis for Bill.
> I promised Bill *The Wave Mechanic* that I would provide the forum 
> with something more substantial than the *candy floss* of 
philosophy 
> and psychology.
> Honouring my promise here is my attempt.
> 
> It is an example of proceeding from a subjective view of the 
markets 
> (theory, intuition, guess, hunch etc) to an objectively verified 
> hypothesis that could form the basis of a trading plan.
> It is intended as an introductory topic to trading.
> 
> I dedicate this post to all mathematicians past and present.
> God knows why he/she didn't include me in that group; it appears 
> he/she had other plans for me.
> 
> 
> *******************************************************************
> General Theory (of market relativity) No1.
> 
> The behaviour of markets in the major western cultures is similar 
> (USA, Australia, UK & others?)
> The markets are moved by institutional investors who control the 
> major portion of the money.
> Institutional behaviour has characteristics that can be utilised 
by 
> freelance traders.
> Institutional investors are people and will exhibit some 
behaviours 
> typical of people in general.
> Based on personal observation of institutions, people and people 
in 
> institutions I expect markets to exhibit some of the following 
> behaviours to some extent:
> ( I don't comment on other markets because I haven't lived in 
those 
> countries and don't understand the psyche the way I understand the 
> psyche of the above group. That doesn't place any relative value 
> judgement on other cultures).
> 
> Institutions have budget cycles (weekly, monthly, quarterly, 
yearly?)
> Institutions are bound by rules of governance and obligations.
> It is not in the interests of institutional players to stick their 
> heads up out of the trench.
> Institutions set employees targets which are benchmarked against 
> industry norms. 
> People have short memories.
> People *work* from Mon-Fri, 9-5 .
> People get Mondayitis and Fridayitis.
> 
> There are many more similar observations.
> I have only provided a few as examples.
> 
> 
********************************************************************
> 
> Hypothesis derived from General Theory No1.
> 
> The markets will behave differently on Mondays compared to average.
> 
> 
********************************************************************
> 
> Verification of the Hypothesis.
> 
> The following is summarised from R.W Colby's *Encyclopedia of 
> Technical Market Indicators*,  published by McGraw-Hill.
> The original is from the writings of Arthur A. Merrill author of 
> *Behaviour of Prices on Wall St*.
> It is presented for educational purposes.
> 
> The Chi-squared test ( a statistical method) is used to tell us 
how 
> reliable an indicator is and if the patterns exhibited by data 
could 
> have been produced by chance.
> The source of the data that the test is performed on is not given, 
> which means that the results are not independently verifiable by 
the 
> forum.
> On that basis it is only provided to demonstrate the principles.
> 
> Trading from 1952 to 1983:
> 
> the number of Mondays when the market rose was 669 
> versus Monday falls 865 
> (1534 in total).
> Average for all trading days = = 52.1% updays.
> Expected rises for Monday = = 52.1% x 1534 = = 799.
> Expected downs for Mondays = = 47.9% x 1534 = = 735.
> 
> Using the absolute of the (actual ? expected) values for up/down 
> days the Chi-squared test (with Yates correction) for statistical 
> signifance returns the value 43.81;
> 
> (((abs(a1-e1) ? 0.5)^2)/e1) + (((abs(a2-e2) ? 0.5)^2)/e2)
> 
> (((abs(669-799) ? 0.5)^2)/799) + (((abs(865-735) ? 0.5)^2)/735) = 
= 
> 43.81
> 
> Based on the Chi-test score there is less than one chance in 1000 
> that the observed outcome for Mondays was due to chance alone.
> 
> 
********************************************************************
> 
> Please note!
> 
> I can't comment on the veracity of the Chi-squared test.
> I will have to leave that to the mathematicians and rightly so.
> I provided the example only to stimulate debate or interest in 
> statistics as a powerful trading tool.
> 
> The general theory of the market is my own personal view.
> I have not verified the above results myself nor have I attempted 
to 
> develop a trading system based on a Monday trading cycle, or any 
> other calender cycle for that matter.
> I have, however, successfully developed and tested a trading 
system 
> based on another hypothesis that was derived from the above 
> GeneralTheory.
> 
> 
> 
> BrianB2......<:-)......(the last of the coneheads?).
> 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "brian.z123" <brian.z123@> 
> wrote:
> >
> > Statistics for traders.
> > Can anyone recommend a book on statistics written specifically 
for 
> > traders or that applies statistical methods to trading examples?
> > I am looking for an author who has done a good job on the 
subject.
> > Even if it is only a section of a book that would do provided it 
> > goes beyond a superficial treatment of the subject.
> > 
> > For anyone interested here is a link to a very good introduction 
> or 
> > refresher for statistics.
> > The HTML *book* takes your from 0-50kph in approx 100 pages.
> > Please note; the site does contain a lot of advertisements but 
it 
> is 
> > also a  mini portal for stats and it does have links to free 
> > statistical stuff and free tools.
> > 
> > Outside of writing indicators I find statistics to be one of the 
> few 
> > maths disciplines that has a high degree of relevance to trading.
> > 
> > http://davidmlane.com/hyperstat/index.html
> > 
> > BrianB2.
> >
>




Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.27/517 - Release Date: 11/3/2006