StockFetcher Forums · General Discussion · looking for help with date related functions<< >>Post Follow-up
altoona2
1 posts
msg #41538
Ignore altoona2
modified
2/24/2006 2:05:28 AM

I'm pretty new to Stockfetcher, and have successfully made several filters. But I could use some help on a date shifting calculation. I've seen some discussion of the "date offset" function but when I've tried it have received errors. Here's what I'm trying to accomplish: I used one filter to make a list of about 50 stocks that have at least a 2:1 ratio between high and low in the last 52 weeks, and a few other qualifications, and called it "Gammascalp." Now I want to use that list and be able to plug in the number of trading days before the next options expiration and have it give me three columns. Each of those columns will show the difference between high and low closing prices during each of the three previous periods of that number of trading days.

Here's my filter:

Fetcher[set{xdays, 25}
set{H1st, close xdays high}
set{L1st, close xdays low}
set{Rge1, H1st - L1st}
set{H2nd, close (2*xdays - xdays) high}
set{L2nd, close (2*xdays - xdays) low}
set{Rge2, H2nd - L2nd}
set{H3rd, close (3*xdays - 2*xdays) high}
set{L3rd, close (3*xdays - 2*xdays) low}
set{Rge3, H3rd - L3rd}
Show stocks where close above 40
add column Rge1
add column Rge2
add column Rge3
and apply to watchlist(GammaScalp)
]



I don't get any runtime error messages, and the output for "Rge1" makes sense, while the outputs for "Rge2" and "Rge3" are way too high. There's something wrong with the way I'm asking it to determine the range in the two earlier periods.




nikoschopen
2,824 posts
msg #41540
Ignore nikoschopen
2/24/2006 2:29:34 AM

Ure faced with another typical "nesting" problem. For example, you could break down the following set statements further:

set{H2nd, close (2*xdays - xdays) high}
set{L2nd, close (2*xdays - xdays) low}

set{H3rd, close (3*xdays - 2*xdays) high}
set{L3rd, close (3*xdays - 2*xdays) low}


As noted elsewhere, the problem lies more with the parser that SF uses than ure filter writing.


StockFetcher Forums · General Discussion · looking for help with date related functions<< >>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.