StockFetcher Forums · General Discussion · Need help with what I think should be a simple filter<< >>Post Follow-up
JohnT328
26 posts
msg #148433
Ignore JohnT328
7/9/2019 6:20:00 PM

Hi, I don't think this is right because for the most part, it is not filtering stocks that were more than 4% below their EMA (17) within the last 15 trading days. Can someone take a look at help?

"Price was at least 4% below EMA(17) within the last 15 days and price is above EMA(17) and exchange is not OTCBB and exchange is not ETF and exchange is not AMEX and average volume is above 1,000,000 and price is between 15 and 1000 and optionable and the Historical Volatility(100,1) is above 20 and optionable and RSI (14) is below 69"

compound_gains
182 posts
msg #148434
Ignore compound_gains
7/9/2019 7:14:58 PM

PPO(10,50) was at least 4% below EMA(17) within the last 15 days and price is above EMA(17) and exchange is not OTCBB and exchange is not ETF and exchange is not AMEX and average volume is above 1,000,000 and price is between 15 and 1000 and optionable and the Historical Volatility(100,1) is above 20 and optionable and RSI (14) is below 69

Fetcher[
count(ppo(10,50) more than 3.99% below ema(17), 15) above 0
close above ema(17)
not otcbb
not etf
not amex
average volume(30) above 1000000
close between 15 and 1000
optionable
historical volatility(100) above 20
rsi(14) below 69
]



JohnT328
26 posts
msg #148435
Ignore JohnT328
7/9/2019 7:42:00 PM

Thank you for this but I don't think it works. For example, TSLA has not traded more than 4% its ema(17) within the last 15 trading days and it is in the filter

xarlor
114 posts
msg #148436
Ignore xarlor
7/9/2019 9:32:29 PM

TSLA below EMA(17) was:
5% on 07/05/19
6% on 07/03/19
4% on 07/01/19

All these satisfy the "within last 15 days" requirement. See the following filter and go back to those days:

Fetcher[
symlist(TSLA)

set{var1,ema(17)}
set{var2,close}
set{var3,var1/var2}
set{var4,1-var3}

add column var1
add column var2
add column var4

draw ema(17)
]




Your filter request here:

Fetcher[
close > ema(17)
not otcbb
not etf
not amex
average volume(30) > 1000000
close between 15 and 1000
optionable
historical volatility(100) > 20
rsi(14) < 69

set{var1,ema(17)}
set{var2,close}
set{var3,var1/var2}
set{var4,1-var3}
set{var5,count(var4 > 0.04,15)}
var5 > 0

add column var1
add column var2
add column var4
add column var5
]



JohnT328
26 posts
msg #148437
Ignore JohnT328
7/9/2019 9:46:00 PM

You are looking at daily charts right? When I go to stockcharts and look up daily TSLA, it does not go below EMA (17). What am I missing here?

Also, in your charts, if the green line is EMA (17), you can clearly see by the actual charts you posted, that price is not below EMA (17), nonetheless at least 4% below it....

xarlor
114 posts
msg #148438
Ignore xarlor
modified
7/9/2019 10:20:58 PM

My mistake, I misread it as EMA(17) below price. Just switched var1 and var2 around and I think this is what you're after:

Fetcher[

close > ema(17)
not otcbb
not etf
not amex
average volume(30) > 1000000
close between 15 and 1000
optionable
historical volatility(100) > 20
rsi(14) < 69

set{var1,price}
set{var2,ema(17}
set{var3,var1/var2}
set{var4,1-var3}
set{var5,count(var4 > 0.04,15)}
var5 > 0

add column var1
add column var2
add column var4
add column var5

do not draw var5
]



Note I used price as the condition, not close. That means if any time during the day the price reached 4% below EMA(17) it will count. Or did you just want it to count if the close is 4% below?

JohnT328
26 posts
msg #148442
Ignore JohnT328
7/10/2019 7:54:14 AM

This works perfect. Thanks for your help!

StockFetcher Forums · General Discussion · Need help with what I think should be a simple filter<< >>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 2018 - 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