StockFetcher Forums · Filter Exchange · % of time above a stock's 20-day EMA<< 1 2 >>Post Follow-up
glgene
616 posts
msg #99170
Ignore glgene
2/16/2011 11:18:25 PM

Need some help here. I was at an IBD Meet-up last night, and the facilitator said his software could track this:

"Show the % of time over the last 100 market days a given stock symbol (e.g., ETN) was above its 20-day EMA."
His answer, for ETN, was 95%.

Can this be programmed into SF? Using the Count feature, but showing the output in % format (such as 95%)? I haven't used such feature, so I would appreciate any help here with building this SF script (using a Symlist of stock symbols).

If someone can help, THANKS in advance.

Gene


glgene
616 posts
msg #99171
Ignore glgene
2/16/2011 11:58:37 PM

Here is my start, but not sure how to include the Count feature, to show what % of time a stock symbol (e.g., ETN) is above its 20-day EMA over the past 100 market days.

Fetcher[
symlist (etn)
draw ema(20)
]



Can someone complete my desired script? Thanks!

Gene

glgene
616 posts
msg #99173
Ignore glgene
2/17/2011 12:15:19 AM

OK, I followed the sample script in the online manual (page 124), and now tried this as my script:

Fetcher[
symlist (etn)
count(ema(20), 100)
draw ema(20)
]



It doesn't work.

The "count" example on page 124 shows:

Count (indicator, length)

SOS?





mystiq
650 posts
msg #99177
Ignore mystiq
2/17/2011 3:19:11 AM

glgene
msg #99173
- Ignore glgene 2/17/2011 12:15:19 AM

OK, I followed the sample script in the online manual (page 124), and now tried this as my script:


Fetcher[
symlist (etn)
count(ema(20), 100)
draw ema(20)
]





It doesn't work.

The "count" example on page 124 shows:

Count (indicator, length)


count(ema(20) "DOES WHAT", 100) ---?
should be count(close > ema(20) , 100)



bkhurana43
103 posts
msg #99178
Ignore bkhurana43
2/17/2011 6:32:13 AM

glgene

Fetcher[symlist (etn)
set{VAR1, count( close > ema(20), 100)}
draw ema(20)
add col VAR1
]


will this serve the purpose.? By the way what is IBD strategy behind this?

Kevin_in_GA
4,599 posts
msg #99180
Ignore Kevin_in_GA
2/17/2011 6:41:15 AM

"Show the % of time over the last 100 market days a given stock symbol (e.g., ETN) was above its 20-day EMA."
His answer, for ETN, was 95%.

+++++++++++++

First, recognize that his answer is already out of date, but try the following:

Fetcher[

symlist(etn)
set{answer, count(close above ema(20),100)}
add column answer
]




glgene
616 posts
msg #99182
Ignore glgene
2/17/2011 10:54:12 AM

bkhurana and Kevin,

Right on the money! Thank you.

One further question, though (from my orig. question). I need to convert the answer to a %. I know with the 100-day count, if the answer is 98, then I can easily 'see' that means 98%. But let's change it to a 50-day lookback. If the count is 30, I need the answer to show as 60% (30/50), not 30 (the actual count).

Is the % column doable? Could you show me? Thanks, again!

Gene

p.s. From my orig. question, I reference I heard this at an IBD session, which WAS my source. But the guy who made the statement said he was computing the number in Trade Station software (not IBD software). When he made his statement, my antenna went up, figuring it could be done in StockFetcher I just didn't know how, since I had never previously used the Count command.



Kevin_in_GA
4,599 posts
msg #99186
Ignore Kevin_in_GA
2/17/2011 3:23:02 PM

Fetcher[


symlist(etn)
set{answer, count(close above ema(20),50)}
set{percentanswer1, answer / 50}
set{percentanswer, percentanswer1 * 100}
add column answer
add column percentanswer

]



glgene
616 posts
msg #99187
Ignore glgene
2/17/2011 4:04:46 PM

Thanks, again, Kevin.

You are so helpful. I really appreciate it.

One question: Is there any way of truncating the decimal info? So, for example, it would print as 96, instead of 96.00? Or is that a SF programming fix issue? The decimal info, if it's always .00, doesn't add anything to the results; just takes up space.

Gene

bkhurana43
103 posts
msg #99192
Ignore bkhurana43
modified
2/17/2011 9:09:28 PM

Values are rounded up to 2 decimal places e.g: substitute 49 days for period instead of 50, you will get percenanswer calculated upto two decimal places.

StockFetcher Forums · Filter Exchange · % of time above a stock's 20-day EMA<< 1 2 >>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.