StockFetcher Forums · General Discussion · moving average (help)<< >>Post Follow-up
Adrian
5 posts
msg #155444
Ignore Adrian
1/26/2021 2:18:36 AM

Hi, I am new to stockfetcher. I search around the forum and example but still cannot figure out how to write a filter for this condition. I would scan the following diagram

Scenario 1 :
1) ma(2) > ma(5) > ma(10)
2) ma (2) crossed above ma(10) yesterday
3) ma (2) crossed above ma(5) yesterday
4) 3 days ago: candlestick 's low is below ma(25) but the close is above ma(25)
5) today's low is higher than yesterday's low and yesterday's low is higher than 2 days ago's low

Scenario 2:
1) ma(2) crossed above ma(10)
2) ma(2) crossed above ma(5) within last 2 days
3) the intersection point between ma(2) and ma(5) is higher than ma(25) 10% or less
or the lowest of last 7 days is located within max. 10 % above ma(25)

Thank you very much.

Ad



xarlor
585 posts
msg #155452
Ignore xarlor
1/26/2021 1:57:07 PM

Fetcher[
/* 1) ma(2) > ma(5) > ma(10) */
ma(2) > ma(5)
ma(2) > ma(10)
ma(5) > ma(10)

/* 2) ma (2) crossed above ma(10) yesterday */
ma(2) 1 day ago crossed above ma(10) 1 day ago

/* 3) ma (2) crossed above ma(5) yesterday */
ma(2) 1 day ago crossed above ma(5) 1 day ago

/* 4) 3 days ago: candlestick 's low is below ma(25) but the close is above ma(25) */
low 3 days ago < ma(25) 3 days ago
close 3 days ago > ma(25) 3 days ago

/* 5) today's low is higher than yesterday's low and yesterday's low is higher than 2 days ago's low */
low > low 1 day ago
low 1 day ago > low 2 days ago
]



For Scenario 2, can't be done in SF since you cannot store a date for recall later. We need to know the date the intersection happened, which we can do. However, we cannot recall that date as a variable to calculate step 3.

Adrian
5 posts
msg #155457
Ignore Adrian
1/26/2021 8:14:52 PM

Thanks xarlor.

For Scenario 2, the candlestick is the most closer to ma25. (for example within +/- 10% higher or lower than ma25), it happens in one date within last 7 days,.

Thank you.

nibor100
1,042 posts
msg #155481
Ignore nibor100
1/29/2021 9:42:49 AM

@Adrian,

What do you mean by

"the candlestick is the most closer to ma25. (for example within +/- 10% higher or lower than ma25),"

Do you want the entire price range of the daily candlestick to be close to the Ma(25) or just the close of the candlestick or the high, etc.....

Thanks,
Ed S.

Adrian
5 posts
msg #155522
Ignore Adrian
2/1/2021 3:50:57 AM

@nibor100,

I would like to search for the scenario
1) ma(2) crossed above ma(10)
2) ma(2) crossed above ma(5) within last 2 days
3) there is a candlestick 's low is the most closest to ma(25) within last 7 days.
The low of the candlestick is above ma(25) around 10 % max or touch ma(25)


Thanks for your help in advance.

Adrian

nibor100
1,042 posts
msg #155551
Ignore nibor100
2/2/2021 4:14:29 PM

@adrian,

I'm not sure how much range above the ma(25) you want as setting the difference between the candlestick low and the ma(25) to Zero, in the filter below, returns at least 100 stocks just for the current day?

Thanks,
Ed S.

Fetcher[
ma(2) > ma(10)

ma(2) crossed above ma(5) within the last 2 days

set{var1, low - ma(25)} add column var1 draw ma(25)

draw var1 add column low
add column ma(25)
var1 equals 0

/*var1 > -0.00001
var1 < 0.01*/

draw low 1 day low on plot price
]





StockFetcher Forums · General Discussion · moving average (help)<< >>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.