frequency of events

R

rokafella

I have a data set that inlcudes date, open and close.

I'm trying to figure out what percentage of the time something happens
Like, what percentage of the time were the last 3 closes higher an
the following open was higher than the last close. So something lik
what percentage of time is CLOSE3>CLOSE2>CLOSE1(the last 3 closes mus
be higher than the previous after each day) and OPEN1> than CLOSE3
Example of data:

DATE OPEN CLOSE (My notes)
19820421, 116.350, 117.450 Close 1
19820422, 117.000, 117.900 Close 2
19820423, 118.350, 119.650 Close 3
19820426, 119.300, OPEN1

Any help would be appreciated.
Ro
 
D

Dennis Saunders

Not elegant but it works for me. Enter this formula in D5 and copy down to
D371 (for a year's trading?)

=IF(B5="","",IF(AND(B5>C4,C4>C3,C3>C2),1,0))

In D1 enter

=SUM(D5:D371)/COUNTA(D5:D371) and format as %age.
You'll have to adjust it 'cos of your notes (in col D) and it's my bowling
night ;)
Regards Radar
 
Top