StockFetcher Forums · General Discussion · Count an event since another event?<< >>Post Follow-up
lctrcbddha
28 posts
msg #66391
Ignore lctrcbddha
8/19/2008 1:30:15 PM

Is there a way to count the number of times a certain event has occured since the last time a different event occured?

Silly example - count the number of times a 52-week high has been set since the last time a 52-week low was set.

I thought that something like the following would work:

set{DAYS_SINCE_LOW,days(low reached new 52 week low,100)}
set{NUM_HIGHS,count(high reached new 52 week high,DAYS_SINCE_LOW)}

But debug says, "Warning: no period specified for count." Note that this is not the same error generated by a period of 0.

Any other ways?

Thanks!

- Bill

chetron
2,817 posts
msg #66393
Ignore chetron
8/19/2008 1:34:56 PM

maybe...

Fetcher[

set{DAYS_SINCE_LOW,days(low reached new 52 week low,100)}
set{NUM_HIGHS,count(DAYS_SINCE_LOW below .5,100)}

add column DAYS_SINCE_LOW
add column NUM_HIGHS

draw NUM_HIGHS
draw DAYS_SINCE_LOW
]



chetron
2,817 posts
msg #66401
Ignore chetron
8/19/2008 2:50:56 PM

OR EVEN....

Fetcher[


set{DAYS_SINCE_LOW,days(low reached new 52 week low,100)}
set{NUM_HIGHS,days(HIGH reached new 52 week HIGH,100)}
SET{HILODIFF,DAYS_SINCE_LOW - NUM_HIGHS}

add column DAYS_SINCE_LOW
add column NUM_HIGHS
ADD COLUMN HILODIFF

DRAW HILODIFF
draw NUM_HIGHS
draw DAYS_SINCE_LOW

]



lctrcbddha
28 posts
msg #66405
Ignore lctrcbddha
8/19/2008 4:23:45 PM

That will work. Thank you!

StockFetcher Forums · General Discussion · Count an event since another event?<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2016 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus