StockFetcher Forums · General Discussion · How? average gap DOWN value | and average gap UP value | over X days<< >>Post Follow-up
fotchstecker
304 posts
msg #150042
Ignore fotchstecker
modified
12/28/2019 3:54:16 PM

I've been working on this for a couple of days using all the examples I can find, including custom statements as well SF's built-in gap expressions. I haven't done it yet.

Does anyone know how to output a value for:

1. The average gap DOWN (price diff between open and previous day close is < 0) over the past 100 days?

2. The average gap UP (price diff between open and previous day close is > 0) over the past 100 days?

I'm able to easily find the absolute gap change value, but can't output values for only GAPS-UP and GAPS-DOWN.

Seems like it should be easier in SF, but I'm struggling with it. Any ideas?


fotchstecker
304 posts
msg #150057
Ignore fotchstecker
12/31/2019 9:39:16 PM

{bump}
anyone have any ideas on this?
I know there are some very strong filter folks out there. Sadly, I'm not to be counted among you.
HNY to all!

nibor100
1,044 posts
msg #150068
Ignore nibor100
1/2/2020 1:10:07 AM

@fotchstecker,

I modified parts of 1 of Xarlor's filtrers to get the below filter, that I believe returns the gaps up average for the past 12 days. Check it out and see if its what you want.

I did not include any comment lines but I can provide them if anyone needs them for the filter logic.

Ed S.

Fetcher[
market not otcbb
average volume(30) > 1234567
set{GapUps,count(close-to-open gap > 0,12)} add column gapups

set{xgap, open - close 1 day ago} add column xgap
set{xgapup, count(xgap > 0, 1)} add column xgapup

set{xxgap, xgap * xgapup}
set{gapsum, sum(xxgap,12)} add column gapsum

set{gapsupavg, gapsum/gapups} add column gapsupavg
]



fotchstecker
304 posts
msg #150069
Ignore fotchstecker
modified
1/2/2020 10:47:46 AM

Hi, nibor. I really appreciate the reply and help. Here's my extrapolation for "downs" based on your example:
Submit
Fetcher[
set{GapDowns,count(close-to-open gap < 0,12)} add column gapdwns

set{xgap2, open - close 1 day ago} add column xgap2
set{xgapdn, count(xgap2 < 0, 1)} add column xgapdn

set{xxgap2, xgap2 * xgapdn}
set{gapsumdn, sum(xxgap2,12)} add column gapsumdn

set{gapsdnavg, gapsumdn/gapdowns} add column gapsdnavg
]




nibor100
1,044 posts
msg #150071
Ignore nibor100
1/2/2020 12:07:32 PM

other than the typo in "add column gapdwns" that is exactly how I would have coded it.

does it do what you want?

Thanks,
Ed S.

fotchstecker
304 posts
msg #150087
Ignore fotchstecker
1/3/2020 10:38:50 AM

It does indeed, I believe. I really appreciate your help on it. Thank you.

StockFetcher Forums · General Discussion · How? average gap DOWN value | and average gap UP value | over X days<< >>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.