StockFetcher Forums · General Discussion · Weekly Range Midpoint help needed<< >>Post Follow-up
kraalarw
18 posts
msg #160522
Ignore kraalarw
8/25/2023 9:44:55 PM

Hi, I would appreciate any help with creating StockFetcher code for weekly data. Specifically, I'm wanting the filter to find symbols where the Current Weekly Close ends up very near the Weekly High/Low Range Midpoint for the current week. For example, within 1% Above or Below the Current Weekly Range Midpoint.

Thank you in advance for any help with this.

xarlor
565 posts
msg #160523
Ignore xarlor
8/26/2023 10:44:03 AM

Fetcher[
set{mid1,low + high}
set{mid,mid1 / 2}

set{1pu,mid * 1.01}
set{1pd,mid * .99}

close < 1pu
close > 1pd

add column high
add column low
add column mid
add column 1pu
add column 1pd
add column close

do not draw 1pu
do not draw 1pd

chart-display is weekly
]



kraalarw
18 posts
msg #160524
Ignore kraalarw
8/26/2023 11:28:52 AM

Thank you so much for your help!
Unfortunately though, it appears that the code you provided is calculating the midpoint solely based on the Daily Hi/Low range of the Current Day. Instead, is there a way for the code to be written so the midpoint would be calculated using the Hi/Low range of the Current Week (Monday thru Friday for a Regular Week; or whatever Days are available for Weeks that include Holiday(s)?

If so, I certainly would appreciate you're further assistance.

xarlor
565 posts
msg #160525
Ignore xarlor
modified
8/26/2023 12:29:20 PM

When you include "chart-display weekly" it's supposed to convert all daily values to weekly values. So the close, midpoint, high, and low are weekly close, weekly midpoint, weekly high, and weekly low.

Please see my post here for more detailed info.

It does not appear to be doing so in this case so I'll try and work on it some more.

xarlor
565 posts
msg #160526
Ignore xarlor
8/26/2023 12:41:39 PM

Though you will have to keep the display as a daily chart, this gets you closer to what you were after.

Fetcher[
set{mid1,low 5 day low + high 5 day high}
set{mid,mid1 / 2}

set{1pu,mid * 1.01}
set{1pd,mid * .99}

close < 1pu
close > 1pd

add column high 5 day high
add column low 5 day low
add column mid
add column 1pu
add column 1pd
add column close

draw price line at high 5 day high
draw price line at low 5 day low

do not draw 1pu
do not draw 1pd
]



kraalarw
18 posts
msg #160527
Ignore kraalarw
8/26/2023 1:39:12 PM

Again Thanks for your time and effort; especially on a weekend!
I have reviewed your previous post for a similar problem involving Weekly Charts; and I follow your logic that by including the "chart-display is weekly" line of code it should convert daily values to weekly values.
However I have 2 points:
(1) When I copy the code exactly as you have it into a new filter; it gives me 8,916 results (which may be close to the entire universe of stocks and ETF's).
(2) Using the SPY (which is the 2nd result) as an example; the Midpoint result given on the filter run is 438.15.....and this is the exact Midpoint for this past Friday's Daily data: High 441.30, Low 435.00, and the Midpoint is 438.15. However, the SPY High of the Week is 445.22, and the Low of the Week is 435.00.....calculated out, this results in a Midpoint for the Week being 440.11.
Also, I've looked at some of the other filter results, and this same thing appears to be happening.
Could you please look into this further, and let me know if the code can be adjusted in such a manner so that the Midpoint will be based on the actual High and Low for the Week?
Thank You.

kraalarw
18 posts
msg #160528
Ignore kraalarw
8/26/2023 1:46:59 PM

Please disregard my previous message; I guess I must have copied the original code you sent instead of the modified version. Everything appears to be working correctly now.
Thanks again for your timely support!

StockFetcher Forums · General Discussion · Weekly Range Midpoint help needed<< >>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.