9:1 Up/Down volume analysis

Joined
5/2/06
Messages
12,760
Points
273
Up Volume Down Volume & SP500 Data
The file has 4 cols. Col 1 is Date in YYYYMMDD format, Col 2 is Up Volume in millions, Col 3 is Down Volume in Millions, Col 4 is S&P500 Index close.

Download the data into an excel spread sheet, compute the up/down volume ratio in a new column and then identify every signal ( 2 instances of U/D ratio > or = 9.0 within a 65 day window).

Next eliminate signals that occurred in your signal period window.
 

Attachments

  • updn4208.txt
    updn4208.txt
    465.7 KB · Views: 68
  • UDRatio.JPG
    UDRatio.JPG
    165.7 KB · Views: 91
Andy how do you define "up volume" and "down volume" :-- is the reference for up/down the last day's close or is it the last trade -- Also are only SP500 stocks considered for the aggregate or the total aggregate volume.

Also the volumes are the volumes at NYSE or at some other exchange?


Col 2 is Up Volume in millions, Col 3 is Down Volume in Millions,
 
SP,
Upside Volume (UV): the sum of all shares traded that closed with a positive price change on the day
Downside Volume (DV): the sum of all shares traded that closed with a negative price change on the day
Up / Down Volume Ratio: UV / DV

These are SP500 index closing prices, volumes of each trading day on NYSE from 1942 till now. We will use the 9:1 rules to generate buy signals.

The daily up/down volume ration must exceed a threshold of 9.0 TWO times within a 65 day period
One penetration is not enough to generate signal
Note the signal occurs on the 2nd penetration of the threshold
The penetrations must come close in time: no more than 65 days apart
The rule is purported to signal the start of important upside movements in the general stock market
Entry Rule only – there is no exit rule
Leaves open the question how long to hold the long position.
 
What are you going to buy? an ETF (the SPY)? What are you going to use for exit strategy?
 
You can buy ETF (SPY), individual stocks in the SP500, VFINX from Vanguard group for example.
Also, there is no exit rule since we are long only fund ..j/k.
I think this is much less focused on the actual buying/selling, but rather focused more on using the historical data and test our rules to generate signals.
Part of it would be to adjust the holding periods, then compare the average return during the holding period versus the non-signal periods.

It's interesting to note that for the last 66 years or so, there are only 287 times when the U/D ratio is >=9.0 and majority of them (233) occurred from 1942 to 1980. Looking at the price time series, one would think most of the buying opportunities happen after 1980.
 
Interesting... I have to find a way to get into this class in the fall...
 
What to buy is still an issue: single stocks maybe just too risky, ETF's may require fundamental knowledge of the sector...

My bigger concern to the strategy would be that we live in fundamentally different world with the advent of all these computer based strategy... With algorithmic trading/ high frequency trading putting more and more orders, I just think testing to data out till 1940's is not a apples to apples strategy...

But definitely a strategy worth thinking about !!!
 
Sample result of 9:1 Up/Down volume analysis

Attached is a sample result for a holding period of 80 days (file is in CSV format but renamed to txt)
Note that the Non Holding period gain is 1042.95 vs a Holding Period gain of 297.02

Since I am unfamiliar with VB, I wrote a PERL script to do the calculations.

Please verify data.
 

Attachments

To clarify, the effectiveness of 9:1 Up Down Volume Rule is by comparing the average daily return from the holding period and the non holding period. That said, in the case of a holding period of 80 days, the average daily return is 0.0754 vs an average daily return of 0.0797 for the non-holding period.

Reading the attached worksheet from my previous posting:
The last 2 columns are the daily returns. This value is computed by taking the closing price of the current day minus the closing price of the previous day. (Closing price of previous day = opening price of current day)

The signal periods are identified in column F (date diff) and column G (comment). The rule is initiated when we have an Update/Down Ratio greater than 9.0. The buy signal is triggered when there are 2 or more ratios are greater than 9.0 in a span of 65 days are more. The number of days is shown in column F; 0 is when the signal is initiated and > 0 is the number of days between the current signal and the previous signal. If that number is greater than 65, a BUY is signaled.

The dates are on column A.
 
Larry,
I believe you are incorrect in some assumption. The buy signal is generated within the 65 day window only. It appears you use > 65 as your criteria so you end up with the buy signal on 7/8/1942. In my calculation, the first buy signal is on 7/9/1942. I'm redoing this in VBA 7/9/1942
I emailed Prof. Aronson with some questions and here is his response.

1) Is 65 days window a fixed number aside from the holding period you will assign each group ?
My understanding is that you find the first instance of UD > 9.0 and find all instance of UD > 9.0 inside this 65 days. The buy signal is at the second instance inside this 65 day window. We will ignore 3rd, 4th, etc instances inside this 65 days window. When this window ends, we will find the next UD > 9.0 and start a new window.

A: Yes the 65 day window to qualify valid signals is fixed and a separate window from the holding period. Your understanding of the signal is correct. It occurs on the 2nd instance of the u/d ratio penetrating or being = to 9.0. Once that happens you are in a signal. Now you impose the holding period for your group. Any signal or instance of a 9:1 penetration that occurs within your holding period is ignored. Yes when the holding period window ends you start looking again for a dual penetration of 9.0

2) Or you will assign each group a holding period and we use it instead of 65 ?
I'm confused about the part you said "Next exliminate signals that occurred in your signal period window "

A: The 65 day period is not a holding period. Rather it is a way to be sure that the two signals are proximate in time. The second penetration of 9.0 must be no more than 65 days later than the first penetration. If it is the second penetration does not trigger a signal.

We will be discussing elimination of signals occurring within your holding period window in tomorrow's lecture

Results are not due until 2/27. Hope this has been helpful. thanks for your interest
 
For 65 day window, here is the buy signals I receive using some VBA code. I believe we should have the same signals to start with.
Buy signals generated for
7/9/1942
10/8/1942
1/21/1943
4/14/1943
7/29/1943
9/18/1943
12/30/1943
6/12/1944
9/15/1944
12/28/1944
4/11/1945
7/25/1945
11/26/1945
1/28/1946
5/7/1946
9/11/1946
12/9/1946
3/5/1947
5/28/1947
10/14/1947
3/31/1948
8/17/1948
11/15/1948
6/15/1949
7/13/1949
12/3/1949
4/6/1950
7/18/1950
11/9/1950
4/5/1951
5/2/1952
11/18/1952
6/17/1953
10/15/1953
11/3/1954
1/10/1955
10/12/1955
2/15/1956
10/2/1956
10/23/1957
12/24/1958
6/28/1962
11/12/1962
11/29/1963
10/12/1966
5/27/1970
11/29/1971
9/19/1975
11/1/1978
4/22/1980
3/22/1982
8/20/1982
8/2/1984
12/18/1984
1/2/1987
10/29/1987
6/8/1988
7/29/2002
3/17/2003
8/16/2004
6/15/2006
3/21/2007
8/29/2007
11/28/2007
 
Now apply the 120 days holding window, here is the buy signals left. Hopefully someone got the same signals.
7/9/1942
1/21/1943
7/29/1943
12/30/1943
6/12/1944
12/28/1944
7/25/1945
1/28/1946
9/11/1946
3/5/1947
10/14/1947
3/31/1948
11/15/1948
6/15/1949
12/3/1949
7/18/1950
4/5/1951
5/2/1952
11/18/1952
6/17/1953
11/3/1954
10/12/1955
10/2/1956
10/23/1957
12/24/1958
6/28/1962
11/29/1963
10/12/1966
5/27/1970
11/29/1971
9/19/1975
11/1/1978
4/22/1980
3/22/1982
8/20/1982
8/2/1984
1/2/1987
10/29/1987
6/8/1988
7/29/2002
3/17/2003
8/16/2004
6/15/2006
3/21/2007
8/29/2007
 
Definition of 120 days holding period

Are we assuming trading days only and excluding weekends from the 120 days holding period?
 
Before I post them, are we selling on 120th day or 121st day?
there are 2 days in my list that I need to recalculate but you probably should have the same signals as I have.
I believe we start the holding period the day after the first signal. My first signal is 7/9/42, so the holding period starts on 7/10/42. We sell on 121th day i.e holding for full 120 days.

Are we assuming trading days only and excluding weekends from the 120 days holding period?
Only trading days. Use the SP500 dates as it only contains the trading date. If you add 120 to 7/10/42 in Excel, it will calculate based on the calendar but we need to add only the trading dates. What I did is have a row number of where 7/10/42 is and add 120 to that number of row.
 
My dates

See attachment for dates used. Useful tab is Indentifying Buy signals, I list the dates of the first signal, second signal, buy and sell dates.
Still a work in progress.

Brian
 

Attachments

Here is my final sheet.

U/D ratio 9
Window (days) 65
Holding period (days) 120
Number of buy signals 44



RESULT Holding Period Non-holding
Daily return 0.068% 0.0181%
Annual return 16.999% 4.5363%


t-Test: Two-Sample Assuming Unequal Variances


Holding Period Non-holding
Mean 0.000679946 0.000181453
Variance 7.01211E-05 8.04532E-05
Observations 5209 11811
Hypothesized Mean Difference 0
df 10614
t Stat 3.501045116
P(T<=t) one-tail 0.00023267
t Critical one-tail 1.64499852
P(T<=t) two-tail 0.000465341
t Critical two-tail 1.960188456
 

Attachments

Andy,
I am looking at your data and have a couple of observations:
Line 291 should have initiated the start of a signal and line 314 should be a buy signal, while line 319 is the initiation of the start of another signal.

Attached are my results.
Total number of Buy signals: 44

Daily Non-Holding Gain: 0.019983%
Total Non-Holding Days: 11801
Annual Non-Holding Gain: 4.99581%

Daily Holding Gain: 0.063743%
Total Holding Days: 5219
Annual Holding Gain: 15.9358%

Note: The total days should be 17020 because there is no Gain/Loss on the first trading day
 

Attachments

Andy,
I am looking at your data and have a couple of observations:
Line 291 should have initiated the start of a signal and line 314 should be a buy signal, while line 319 is the initiation of the start of another signal.
Finally your numbers are starting to converge to mine ;)

I'll explain the your observations. Look at the lines in my signal sheet. It contains every date that has UD ratio >9. The numbers refer to the row in data sheet. We all should have exactly the same number here.
Code:
11
157
158
230
235
291
314
319
The rule is we use the second U/D ratio >9.0 as a buy signal within 65 days.
Initally, I have every U/D ratio >9.0 signal marked as Start Windows. I will then use the 65 days to find the start and end of each window. Let's go through each one.
First window is at line 11, the second line is at 157 so there is no buy signal within 65 days. The first buy signal is at 158 since it's within 65 days from 157.
230 is a new start window since 157+65 < 230. Therefore 235 is our second buy signal. We ignore 291 because we don't care about sequential signal within 65 days window.
314 is a new start window since 230=65 < 314. Therefore 319 is our third buy signal

So on, so forth. I will then use the 120 day holding period to pick up the signals we use to calculate daily return. It work in similar fashion as the 65 day window. I have this all done in VBA code.

Hope it makes sense to you now.
 

Attachments

Back
Top Bottom