Australian (ASX) Stock Market Forum

Daily Probability

Joined
16 September 2009
Posts
22
Reactions
0
Current project I am working on evaluates the probability / percent chance that tomorrow will either be up or down.

After some thinking / research I have this:
Probability of an event = P(E)
n(E) = # favourable outcomes
n(S) = # outcomes
P(E) = n(E) / n(S)

Relating the above equation into candle terms:
up1 = # times a day was up
up2 = # times two days were up in a row
total = total number of days / bars

Results from XJO:
up1 = 1244
up2 = 646
total = 2363

Prob any 1 day being up = up1 / total
XJO: 1244 / 2363 = .53 ie. 53% possibility that a day will be up

Prob any 2 days being up = up2 / total
XJO: 646 / 2363 = .27 ie. 27% possibility that 2 up days will occur at any time. Error here?

This is where I think I may have it wrong, calculating prob for tomorrow (XJO):
up1 = 1244 (# times 1 day up)
dn1 = 1119 (# times 1 day down)
up2 = 646 (# times 2 days up)
dn2 = 522 (# times 2 days down)
totaldays1 = 1244 + 1119 = 2363 (total # outcomes for 1 day up or down)
totaldays2 = 646 + 522 = 1168 (total # outcomes for 2 days up or down

Today was up, then tomorrow up as well = (up1 + up2) / totaldays1 + totaldays2 ?

XJO: (1244 + 646) / (2363 + 1168) = .54 ie. 54% that tomorrow will be an up day, if today was an up day ?

Is this correct?

Mark
 
If today was up then shouldn't it simply be probability 646/1244 = 52% that tomorrow will be?

ie for the 1244 cases a day was up, 646 cases went on to give a second up day, 1244-646 times the next day was down.
 
Factor in what America did overnight and to a lesser degree what Asian markets have also done.

Also if any company is a big part of the XJO then when they go ex div expect them to fall
 
Knoxy: think you may have solved my dilemma, thanks

RamonR: plan on including it, just getting the basics down first

Mark
 
I think 52% is right. You can use the equation for conditional probability
P(A/B)=P(AB)/P(B). Doesnt really tell you much without the size of up and down days and their distribution.
 
Think also the the market spends 80% time going up and 20% going down.
Which means the down movement is likely to be more dramatic.

if you get this right do I get a copy of formula for help given thus far?
 
bilo83: you want to apply your conditional probability formula for the example given, if it would give different / more accurate results.

RamonR: happy to post amiboker code if desired - I appreciate the help!

Mark
 
Factor in what America did overnight and to a lesser degree what Asian markets have also done.

Also if any company is a big part of the XJO then when they go ex div expect them to fall

You can probably add commodity prices , AUD currency changes along with what BHP ADRs have done , these things are interconnected though so possibly just one of those may do as an input .
 
No you are wrong.

P(Up) = 0.53
P(Up AND Up) = P(Up)*P(Up) = 0.53^2 = 0.28 -> 28%

total should always be equal to the barcount with regards to your question

When asking if P(X) AND P(Y) occurs, then you need to multiply the probabilities. This applies for P(X) AND P(Y) AND P(Z) AND....
When asking if P(X) OR P(Y) occurs, then you need to add the probabilities.

Again, when calculating P(X), then the total needs to equal the number of bars.


If you eventually manage to code this (I'm assuming you're using amibroker), then you will find that for most asx stocks, when observing P(Up) or P(Down) over many years, the two will be roughly equal. Obviously, you will find a difference in probabilities when you look at a much shorter time frame. IIRC, during 2005-2009 the XAO's P(Up) was almost equal to P(Down), however, during '09, some months had P(Up)=0.6 and P(Down)=0.2 whereas others had P(Down)=0.5 and P(Up)=0.2.
Hopefully the above paragraph has also highlighted another outcome that you aren't considering.
 
And then you have the problem of using the probablities.

Are you taking an Up day from the open of the same day or the close of the day before or from open close the same day?

Because you can have an up open(from yesterdays close) and a down day (open to close same day) And then from there you can still be either up or down from yesterdays close. :confused:

Just a warning, ASX XJO data is of no use unless you are only concerned with close to close.
 
Saiter: Yes I am using amibroker. "P(Up AND Up) = P(Up)*P(Up) = 0.53^2 = 0.28 -> 28%" Wouldn't that be true if I only had data for one day, and was then trying to work it out for two up days? I determine that today was an up day, and am trying to work out the prob that tomorrow will also be up. Maybe try to give an example in my previous XJO terms?

Trembling Hand: in an attempt to sort the basics I am using an up day is close > open. I will expand on that later.

I don't presume that this will be life altering. It's an just an area of interest. XJO is a starting point.

Mark
 
Trembling Hand: in an attempt to sort the basics I am using an up day is close > open. I will expand on that later.

I don't presume that this will be life altering. It's an just an area of interest. XJO is a starting point.

Mark

You are wasting your time then. ASX index data is rubbish in relation to the opening tick. see my blog.
 
This is how I see it at the moment:
The market (XYZ = irrelevant) is like a coin. It can be up (C > O) or it can be down. This coin is up more often than down. I have found:
Numbers after up / down are # times in a row that it occurred. Up3 = up for three days in a row. Different results. So:
up1 = 1307
up2 = 677
up3 = 348
dn1 = 1190
dn2 = 560
dn3 = 271
totalbars = up1 + dn1 = 2497

Today was an up day for XYZ. Given the above info, can it be determined what the possibility that tomorrow will be an up day? If not, what additional info is needed?

I thought that possibility was up2 / up1 = 677 / 1307 = .52 = 52%
Likewise the possibility of having 3 up days in a row was up3 / up1 = 348 / 1307 = .27 = 27%

If you want to quote prob formula's please try to apply them to this exercise.

Once it is determined that I have this initial step correct, THEN I will do other scenarios / markets.

Mark
 
Saiter: Yes I am using amibroker. "P(Up AND Up) = P(Up)*P(Up) = 0.53^2 = 0.28 -> 28%" Wouldn't that be true if I only had data for one day, and was then trying to work it out for two up days? I determine that today was an up day, and am trying to work out the prob that tomorrow will also be up. Maybe try to give an example in my previous XJO terms?

Trembling Hand: in an attempt to sort the basics I am using an up day is close > open. I will expand on that later.

I don't presume that this will be life altering. It's an just an area of interest. XJO is a starting point.

Mark

Probability of 2 up days (i.e. Day 1 = up, Day 2 =up)
XJO: up2/total OR up1/total * up1/total

Probability of any 2 day pattern ending up (i.e. Day 1 = up or down, Day 2 = up)
XJO: up1/total
 
This is how I see it at the moment:
The market (XYZ = irrelevant) is like a coin.
Actually when you get to trading it it isn't like a coin at all.

It can be up (C > O) or it can be down.

No you are missing a very important step when it comes to trading. Firstly are you using that formula with XJO data because you couldn't of got those stats. Pre feb 07 C = O for xjo.

Then you actually may want to look at this formula if you ever want to apply any of this to trading,

Overnight gap +/- intraday movement > yesterdays close, is an up day.

Otherwise you are going to be forced to trade prices that are not available ie gaps and opening/closing prices.

Then of course you will not be able to apply averages of 10 years of data to a trading system. You will blow up before you have a chance of getting the 10 years to work in your favour.
 
Trembling Hand: You seem to have misunderstood my INITIAL market assumption for this exercise. ie. up or down. Yes I am aware that just because today was up doesn't that it was up compared to yesterday, etc. Start simple, get the maths right, then add complexity / real life later.

I just want confirmation that I am calculating the probabilities for this event correctly.

Regarding my initial choice of XJO - who cares? At this point it doesn't matter. Incidentally my XJO data (Premium Data) has O/H/L/C/V data from 3/4/2000 till now. Do you want to pick stock and I'll work with that?

Mark
 
Regarding my initial choice of XJO - who cares?

I thought you would care before you go about wasting time with untradeable prices but apparently not,

And I would give some good thought to applying 10 years average data to a trading system or the basis of a trading methodology. I understand you're looking at the correct maths to apply here but I'm thinking a couple of steps ahead of you - practicality. :cool:
 
Top