[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cycles



PureBytes Links

Trading Reference Links

Chuck,

You pose an interesting question.  Using "valleys" as an
example, what I have done in the past is to start with the
trough function in MetaStock.  Understanding that this
comes from the Zig Zag function, you need to be careful to
use only past values of this indicator.  Current or recent
values will change with each new day of data, so those
would be unreliable.  Looking back you would need to
determine what are the best values of percentage change and
price change to use in the indicator.

Once you've established a good zig zag function/trough
function, you then use BarsSince() to count the periods
between troughs. An average of that result over time might
give you the cycle information that you are looking for. 
Given that the cycles are long enough to give you
sufficient distance from the last trough, you could compare
the barssince() the last trough to see how soon you might
anticipate the next one. 

If you want to take this a step further, you could take the
Standard Deviation of the variation of the cycle period
from the mean to determine whether the stock or contract in
question is too erratic to apply this methodology.

I'm not at my MetaStock computer right now, but if you'd
like, we can take a run at being more specific in the
coding of this in Formula Language.

Dave Nadeau
Fort Collins, CO
----------------------------------------
Charles Warren  wrote: Hi,I am looking to develop an
algorithm for an exploration of stocks that will determine
the frequency (number of time periods) from valley to
valley dips, and where the stock is at relative to a
projected next valley (or peak).  If you manually use the
cycle lines feature on a single stock chart you can place a
starting point (date) and change the frequency of the time
intervals among a series of vertical lines, attempting to
match up the peaks or valleys in a cycling stock over a
time frame.  The goal of the algoithm is to determine if
the stock is near a projected valley (or peak) based on its
past tendencies to form valleys or peaks at certain intervals.Chuck

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/