Predict Wall Street - The Stock Prediction Community

Welcome GuestSearch | Active Topics

How to reliably identify PAST peaks and valleys. Options
f1r3br4nd
#1 Posted : Tuesday, October 27, 2009 8:44:12 PM
Rank: Newbie

Groups: Members

Joined: 10/27/2009
Posts: 3
Hi, I am an okay R programmer, but I'm just learning about technical analysis. I'm trying to write a script for spotting peaks and valleys in historical stock data.

For now, I am *not* trying to predict future prices, just unambiguously identify peaks and valleys in historical information. Seems easy, right?

Well, there seems to be a lot of local minima and maxima. For instance, if I locate the maxima between an upward crossing through the upper 20-day Bollinger band and a downward crossing through the lower 20-day Bollinger band (and the reverse for minima) I often miss the yearly highs and lows while hitting a lot of noise peaks.

Does anybody have suggestions for what technical indicators I should use, and how? MACD, RSI, Bollinger bands, SMA, etc.? Or suggested reading on this topic? I'm sure this has got to be a solved problem among technical analysts.
elmerortega
#2 Posted : Wednesday, October 28, 2009 2:57:55 PM
Rank: Newbie

Groups: Members

Joined: 10/2/2009
Posts: 1
If it´s identifying max & mins what you are trying to do, I think it is the most useful to create an algo for this purpose. Using technical analysis it´s helpful because spotting pivots on these indicators is easier, this is beacuse they usually are smoother series (i.e SMAs). An algo that feeds from both the original series an the tech indicator mite do the trick, at least that´s what I did.
f1r3br4nd
#3 Posted : Monday, November 02, 2009 9:09:27 PM
Rank: Newbie

Groups: Members

Joined: 10/27/2009
Posts: 3
Actually, it turned out to be pretty simple:
1. Pick an N-day window
2. Find the maximum or minimum for the N-day window
3. Is the maximum or minimum also the first value in the N-day window (i.e. on day 0)?

If so, then it is a peak/valley for that window size. If not, move the window along by one day and repeat.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Sponsored Links
Loading...