StockFetcher Forums · Announcements · Date Based References<< >>Post Follow-up
stockfetcher
980 posts
msg #112556
4/1/2013 11:12:14 AM

The new DATE([PERIOD],[INDICATOR]) function allows you to access past values of measures in new ways. In function, this feature works similar to the "days ago" phrase, as it modifies the desired measure; however, you can provide specific instructions on the actual offset of the days ago phrase.

The example below returns matches that are more than 10% above the opening price for the year.

Fetcher[close is more than 10% above DATE(YEARSTART,open)]



To find stocks that are below the RSI(10) from the start of the month:

Fetcher[RSI(10) is below DATE(MONTHSTART,RSI(10))]



Valid options for the "PERIOD" argument:


  • YEARSTART: Initial value of the indicator for the year

  • YEAREND: Last value of the indicator for the prior year

  • MONTHSTART: Initial value of the indicator for the month

  • MONTHEND: Final value of the indicator for the prior month

  • MONDAY - FRIDAY: Value from the specific day of the week

  • YYYYMMDD: Specfic date



Here are a couple more examples:

Fetcher[/* Plot the return based on the start of the year */
set{var1, DATE(YEARSTART,open)}
set{diff, close - var1}
and draw var1 on plot price
and draw diff
and plottype{diff,zerobar}
and close is above 3.00
and average volume(30) is above 250000
]



Fetcher[/* Plot the return based on the start of the month */
set{var1, DATE(MONTHSTART,open)}
set{diff, close - var1}
and draw var1 on plot price
and draw diff
and plottype{diff,zerobar}
and close is above 3.00
and average volume(30) is above 250000
]



Fetcher[/* Reference a specific date */
set{var1,DATE(20130211,close)}
draw var1 on plot price
and close is above 4.00
and average volume(30) is above 250000
]



Fetcher[/* Stocks more than 10% below last year close */
set{var1, DATE(YEAREND,close)}
draw var1 on plot price
and close is more than 10% below var1
and close is above 4.00
and average volume(30) is above 250000
]



Fetcher[/* Price last FRIDAY gained more than 10% */
set{change,close - open}
set{ratio, change / open}
set{pct, ratio * 100.0 }
set{var1, DATE(FRIDAY,pct)}
show stocks where var1 is above 10
and close is above 3.00
and average volume(30) is above 250000
]




Please let us know if you run into any issues with this new function, have any question about how it works, or would like to see any modifications.

StockFetcher Support


mahkoh
1,065 posts
msg #112563
Ignore mahkoh
modified
4/1/2013 4:13:54 PM

+1000 kudos to the SF crew!

Edit: that is if I can get this to work
Fetcher[
nasdaq 100

set{mh,date(monthend,high 21 day high)}
set{ml,date(monthend,low 21 day low)}
set{cl,date(monthend,close)}


set{mp1,cl + mh}
set{mp,mp1 + ml}
set{mpp,mp/3}

set{mr1x,mpp*2}
set{mr1,mr1x - ml}
set{ms1,mr1x - mh}

set{mrange,mh - ml}
set{mr2,mpp + mrange}
set{ms2,mpp - mrange}

set{m2r,mrange*2}
set{mr3,mpp + m2r}
set{ms3,mpp - m2r}

draw price line at mr2
draw price line at ms1
draw price line at ms2
draw price line at mr1
]



This should give me lines at monthly pivot lines. It does not however, although check syntax OK's everything.
Is there a way to code this?

stockfetcher
980 posts
msg #112566
4/1/2013 4:51:24 PM

If possible, can you provide an example where the numbers do not appear to match up with the syntax in your filter? For example, if you can supply a symbol and expected value, that would help us track where there may be any issues.

Thanks!

StockFetcher Support



mahkoh
1,065 posts
msg #112567
Ignore mahkoh
4/1/2013 4:57:52 PM

For some reason it didn't work when I made the changes in my original filter that I had to adjust for lookback days daily:

set{mh,high 21 day high 20 days ago}
set{ml,low 21 day low 20 days ago}
set{cl,close 20 days ago}

to

set{mh,date(monthend,high 21 day high)}
set{ml,date(monthend,low 21 day low)}
set{cl,date(monthend,close)}

but clicking my posted filter above works perfect. +1000 it is, thanks!

olbn
4 posts
msg #113880
Ignore olbn
6/3/2013 6:19:50 PM

Is it possible to add for Optionable stocks to analyze from the Option Expiration Month (Generally 3rd Friday of the Month)?

dangreene
229 posts
msg #156922
Ignore dangreene
6/4/2021 9:27:49 PM

POP to TOP

styliten
297 posts
msg #159584
Ignore styliten
modified
9/11/2022 9:18:47 PM

Here is another way of drawing RELATIVE reference price lines by month based on the entire price range from low 1 month low to high 1 month high:

The following assumes 21 days in an average trading month; feel free to adjust [21] days to 15 or 30 or as you see fit.

A volatile prior month will automatically make the reference price lines for the following month more widely spread out; conversely, a quiet month (in consolidation) will make reference price lines meshed up together. The underlying logic being what if the price trend in the immediate prior month were to continue exactly as it has been? As a result any price behavior pattern deviated from prior month will stand out very quickly to catch one's attention. Because these relative reference price lines stay constant for the entire duration of the current month, there is no moving averages or other curves to distract one's eyes.

Fetcher[dow 30

chart-time is 40 days

set{ref10, date(monthend, day position(0.00, 21))}
set{ref11, date(monthend, day position(0.01, 21))}
set{ref12, date(monthend, day position(0.02, 21))}
set{ref20, date(monthend, day position(0.25, 21))}
set{ref30, date(monthend, day position(0.50, 21))}
set{ref31, date(monthend, day position(0.49, 21))}
set{ref32, date(monthend, day position(0.51, 21))}
set{ref40, date(monthend, day position(0.75, 21))}
set{ref50, date(monthend, day position(1.00, 21))}
set{ref51, date(monthend, day position(0.99, 21))}
set{ref52, date(monthend, day position(0.98, 21))}

and draw ref10 on plot price
and draw ref11 on plot price
and draw ref12 on plot price
and draw ref20 on plot price
and draw ref30 on plot price
and draw ref31 on plot price
and draw ref32 on plot price
and draw ref40 on plot price
and draw ref50 on plot price
and draw ref51 on plot price
and draw ref52 on plot price
]



It can capture price shifts/reversals at bottom and tops better those those based off on "moving averages" or linear regression intercepts alone.

StockFetcher Forums · Announcements · Date Based References<< >>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.