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 581 posts msg #160523 - Ignore xarlor |
8/26/2023 10:44:03 AM
|
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 581 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 581 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.
|
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!
|