Australian (ASX) Stock Market Forum

Daily Probability

Trembling Hand: at the end of this exercise I plan on having a code that spits out something like "There is xYears of data for XJO (insert generic index). Today XJO gapped up and closed up 1% on above average volume. This is the third overall day day up. The index daily trend is up. There is a x% chance that tomorrow will be up. There is xYears of data for BHP. Today BHP was down and closed 0.5% lower on above average volume. There is a x% chance that BHP will be down tomorrow. etc"

What I do with it depends on how meaningful the results turn out to be. Might form part of an entry, adjust a stop, or be background info. Can't reach that place yet till the basics are known.

I'm sorry I don't understand what you mean with "applying 10 years average data to a trading system". Assuming any data is complete with OHLCV info, do you consider 10 years worth of data insufficient for backtesting / evaluating a system? I do appreciate your input.

Mark
 
Firstly Mark I Dont think you are following me here. You simply cannot use any index data from the ASX that includes the opening price. All that can be used is C on C and maybe some of the HL & V data, thats a big maybe.

Away from that, using the last 10 years of data is like trying to predict if it will rain tomorrow from averaging the last 30 years of weather. Its easy enough to get a probability but for tomorrow will that apply if we are in a drought? or if its December or July.

The last 10 years has had 6 years (03-07 & 09) of the biggest bull markets we have seen in a long time. Is the market going to repeat the same patterns in the next 10 years?? Then have a look at volatility on a short term basis, daily ranges & day to day, to see how that is continually expanding and contracting over such a long time.

Then if it does repeat, will your system survive the day to day, week to week, month to month fluctuations of the inevitable moves away from the averages? You could well find a good system that works on 10 years of data but my guess is that you it will also have nasty drawdowns.

And of course I'm not a system trader but do know that the only results that will really count are out of sample results. Are you going to test it for another 5 years to get confirmation?
 
Trembling Hand,
You simply cannot use any index data from the ASX that includes the opening price. All that can be used is C on C and maybe some of the HL & V data, thats a big maybe.

Now I am confused. Is this due to the indices extended trading hours, and the open may not be accurate? Is this limited to ASX indices or is common worldwide?

I am limited to data available, obviously the longer the better. I have 20yrs of data for XAO, for example. Systems traders argue over the validity of new versus old data. But for this exercise, more is better. I recall reading somewhere that you need a minimum of 30 results generally to give a statistically valid inference (another formula to find). Whatever that number that is, if an event runs under that minimum it will be noted in the output text.

Mark
 
Now I am confused. Is this due to the indices extended trading hours, and the open may not be accurate? Is this limited to ASX indices or is common worldwide?

Just to the ASX, the staggered open distorts the first tick, the opening value, for the Indexes. See my last post on my blog

I am limited to data available, obviously the longer the better.
I don't think so. The market is not some static beast. Patterns come, go, breakdown and return all the time. For example have a look at this which is similar to what you are trying to do,
http://tremblinghandtrader.typepad.com/trembling_hand_trader/2007/07/spi.html

It showed that all the bull move was in the overnight gaps. trading this "method", holding only over night & short during the day would of given you $100,000 return uncompounded from $20,000 over 3 years, then look at the date. Just as I found it it broke down.

I think you better look into the more data is better idea. I don't think thats correct, not for a trading system. maybe some of the system traders could help.
 
Trembling Hand: staggered open, makes sense. Will revise code used for index results, with attention to gaps. Thanks for the heads up.

professor_frink: haven't encountered that blog, looks like good info.

Another poster suggested this:
Summing independent events, P(A and B) = P(A) * P(B) BUT working out P(B).

P(A and B) = 2 days up = up2 / totalbars = 677 / 2497 = .27

P(A) = today up = up1 / totalbars = 1307 / 2497 = .52

so P(B) = tomorrow up = P(A and B) / P(A) = .27/.52 = .52 = 52% chance that tomorrow will be up also ?
Likelihood of a third day up = 27%.

Another method, but which one is correct? :banghead:

Mark
 
r22mark,

I have 20yrs of data for XAO,

I think that TH has been a little soft in the way he has communicated to you in this thread. I don't think you understand what he has been saying.

Allow me to elaborate...

This is a totally pointless waste of time.

52% chance that tomorrow will be up also ?
Likelihood of a third day up = 27%.

Good grief....; no wonder academics think the markets are random and can't be beat if they use this type of logical approach to something that is not logical.

Have you bothered to check the variations in probabilities during different periods within the original 10 years of data you used??? TH already told you that the bull and bear phases acted differently, a quick look at any chart over the 10 years will display it.

How would you trade it?? If taking XJO data (cash) the results will be different to the SPI data, as sometimes the SPI trades at a premium, sometimes at a discount, it is not a straight one for one, especially when you are trying to eek out a slight perceived discrepancy in probability over 10 years.

Enough said

brty
 
Trembling Hand: staggered open, makes sense. Will revise code used for index results, with attention to gaps. Thanks for the heads up.

professor_frink: haven't encountered that blog, looks like good info.

Another poster suggested this:
Summing independent events, P(A and B) = P(A) * P(B) BUT working out P(B).

P(A and B) = 2 days up = up2 / totalbars = 677 / 2497 = .27

P(A) = today up = up1 / totalbars = 1307 / 2497 = .52

so P(B) = tomorrow up = P(A and B) / P(A) = .27/.52 = .52 = 52% chance that tomorrow will be up also ?
Likelihood of a third day up = 27%.

Another method, but which one is correct? :banghead:

Mark

Honestly, I've completely lost track of what you are trying to do here, I get confused easily seeing random equations all over the thread:eek:

Here's a simple excel file with some number crunching on it for you. Just dumped some data from yahoo into excel and did a little of my own playing around. Actually scratch the excel file, the forum won't let me upload it:mad:

If today was an up day(based on yesterday's close, the only way to work it for index data), then 50.91% of the time we will see another up day, though trading this is a losing proposition.

If there are 2 consecutive up days, then 51.07% of the time we will see a 3rd up day, though the average trade result is so small you wouldn't even consider following it.
 
ok, now that we have the excel attachment limit on the forum fixed, here's the excel file I was trying to attach last night. Not sure if it'll help you on your quest or not Mark.
 

Attachments

  • XJO example.xlsx
    204.7 KB · Views: 9
brty: First post stated this was a project - I never implied it was the holy grail. I posted asking for help to determine the correct way to calculate the various probabilities, something I still don't have an answer to. I have not implied this is a trading system for stocks or indices. As for "variations in probabilities during different periods", refer to the chart (bottom indicator) below - the prob of a random up day has changed little in the last 10 years. Middle indicator shows consecutive up / down days. Yes you can make some observations in different market states. Yes I do try to look at all the factors. But as you previously commented "This is a totally pointless waste of time." Check out http://www.investmentwarrior.com/Archived%20Articles/111402.htm
That is what I am trying to prove / disprove.

Mark

updndays2.jpg
 
Mark from investmentwarrior.com,

Such inefficiencies make empirical and statistical timing strategies (such as those used in this report) to take advantage of such and produce systems that help to both reduce risk and enhance return

Having a look at the risk to reward of each move, which is about 1:1 not counting brokerage + slippage, I would say the above quote is "totally pointless waste of time" ie BS.

There is no edge there.
 
http://clayallen.com/MD_NEWS_V9_I3.pdf

It is Not Days up vs DAYs down that makes the difference
That is a coin toss

It is how much up vs how much down
when ever price moves
that is the engine of TRENDS
and where persistence resides


Another interesting fact about
the JCG data is that 51% of the days
were up and 49% were down. That is
very close to flipping a coin. The trend
is revealed by the fact that the up days
gained 3.48% on average while the
down days lost considerably less at –
2.27% on average.



Yes you could almost say this chart is driven by a RANDOM PROCESS ( days up<=> days down )

BUT no this chart is NOT RANDOM ( The step sizes are NOT RANDOM )
There are persistent TRENDS

Motorway
 

Attachments

  • Dow Jones Industrial Average asf.gif
    Dow Jones Industrial Average asf.gif
    90.2 KB · Views: 6
r22mark,

The graph you have presented that shows "prob of up day /30 days" is not accurate. Between the 19/5/08 and 15/7/08 there were 41 trading days. On 26 of those days the closing price was lower than the previous close. At no point does your graph fall below a probability of .53 of there being an up day during this period, even though it is per 30 days.

Using my calculator I find that by the 15/7/08 there would be a 63% probability of a down day, if the time was averaged over 41 days, hence I return to my assumption that it is a pointless exercise and I am stupid for wasting my time on it.

brty
 
brty: Apologies. Coding error. You are correct - prob of a single day being up ranges from 30% to 68%, over 30 bars / 10 yrs. That did surprise me.

This exercise has become disappointing. If anyone cares to comment on the initial mathematical question, please do. Otherwise, I won't be continuing this.

Mark
 
brty: Apologies. Coding error. You are correct - prob of a single day being up ranges from 30% to 68%, over 30 bars / 10 yrs. That did surprise me.

This exercise has become disappointing. If anyone cares to comment on the initial mathematical question, please do. Otherwise, I won't be continuing this.

Mark
I don't have a lot to add, aside from a thanks. It was a useful exercise in that it's something most traders ponder at some point. What's next?
 
Top