nikoschopen 2,824 posts msg #52575 - Ignore nikoschopen |
6/26/2007 11:15:08 PM
(1) If you mean by "up down up down" as the price change from open to close and vice versa, you could write it as:
This will find the occurence of an up day, namely the close is above the open, followed by a down day OR a down day followed by an up day within the last 5 days. The column labeled "zigzag5" will give you the number of such occurences within that time frame.
(2) If you mean by "up down up down" as the price change from the yesterday's close to todays's close, you could write it as:
This will find the occurence of an up day, namely it closed higher than yesterday's close, followed by a down day OR a down day followed by an up day within the last 5 days. The column labeled "zigzag5" will give you the number of such occurences within that time frame.
|