StockFetcher Forums · General Discussion · Count of a setup that consist of multiple indicators<< >>Post Follow-up
freshpotato
36 posts
msg #57127
Ignore freshpotato
11/28/2007 6:49:11 PM

Hello,

I know you can use the count feature to check how many times for example a MA(20) has occured during the time period specified.
But, what if I want to check a MA(20) cross AND high above MA(20) occuring on the same day..

set{macross,count(price crosses below MA(20),60)}
set{macross,count(high is above MA(20),60)}

But I need it to only count when the setup is occuring on the same day


nikoschopen
2,824 posts
msg #57128
Ignore nikoschopen
11/28/2007 7:20:52 PM

The column labeled "macross" should tell you how many time within the past 60 days the two crossovers occured.

Fetcher[
set{macross1,count(price crosses below MA(20),1)}
set{macross2,count(high is above MA(20),1)}

set{both, macross1 + macross2}
set{macross, count(both equals 2, 60)}
add column macross
]



freshpotato
36 posts
msg #57152
Ignore freshpotato
11/29/2007 7:51:00 AM

Great!

Thanks a lot

TheRumpledOne
6,407 posts
msg #57158
Ignore TheRumpledOne
modified
11/29/2007 9:21:36 AM

Fetcher[
set{macross,count(price crosses below MA(20),1) * count(high is above MA(20),1) }

macross equal 1

Sort column 3 descending
]



Simple math trick.

If either count is ZERO, then the result is 0.

If both are ONE, then the result is 1.

Don't need to display the column because it will ALWAYS be 1!!

HTH.

nikoschopen
2,824 posts
msg #57163
Ignore nikoschopen
11/29/2007 11:54:56 AM

TRO,

Just for the clarification, the poster already knew that. What he did want to know was how many times those two crossovers occured within the previous 60 days.

HTH

StockFetcher Forums · General Discussion · Count of a setup that consist of multiple indicators<< >>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 2022 - 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


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.