lorypanna 32 posts msg #161707 - Ignore lorypanna |
3/16/2025 7:57:23 PM
Hi
I'm interested in Brian Shannon's teaching about A-VWAP - Anchored Volume-Weighted Average-Price.
I wanted to build a filter which allowed me to screen for stocks with a closing price near some 'important' A-VWAPs. Saying 'important' I mean: 1. A-VWAPs kept into consideration by many traders/investors (based on what Brian Shannon says); 2. A-VWAPs valid (in general) for all stocks, that is independent from anchor-dates specific for each stock (earnings date, highest-high date, lowest-low date, ...); example: quarters' first trading date.
Using the sum(indicator,length) function it's possible to obtain the A-VWAP value on the last bar and to apply filters on it for identifying 'interesting stocks'.
First of all, all the important limitations of the filter I was able to identify:
1. Due to sum(indicator,length) function's limitations, the anchor date cannot be more than 252 bars in past (the SF manual about the function says period limit = 100, but my tests showed that it works till 252)
2. SF data is not adjusted based on dividends and other 'similar events'. Keep this in mind when comparing with other platforms or analyzing downloaded data. As an example, compare the A-VWAPs obtained for LMT with adjusted data on other platforms
3. In case of splits (or reverse splits) SF data is adjusted for price (OHLC) but not for volume. As an example, compare the price/volume data for SMCI before/after 2024-10-01 with other pltaforms' data
4. Filter must be manually updated every day, changing the sum()'s length
5. If the stock's IPO date is more recent than the anchor date, in general the obtained values cannot be 'trusted' bacause sometimes price and volume data exists before IPO date (example: SFD: based on Finviz / TradingView, it IPOed on 2025-01-30, but in SF data exists back in 2024. Maybe this can be explained and it's not wrong, just my ignorance, so consider it FWIW)
As of today, the script uses the following 'important' anchor dates (they can be easily changed):
1. First trading date of 2024-Q2 - On 2025-03-14, 240 trading days have passed since the beginning of 2024Q2 (2024-04-01)
2. First trading date of 2024-Q3 - On 2025-03-14, 177 trading days have passed since the beginning of 2024Q3 (2024-07-01)
3. First trading date of 2024-Q4 - On 2025-03-14, 113 trading days have passed since the beginning of 2024Q4 (2024-10-01)
4. First trading date of 2025-Q1 - On 2025-03-14, 49 trading days have passed since the beginning of 2025Q1 (2024-10-01)
Using the values above cited, four 'Moving VWAPs' can be calculated, whose value on the last available bar (2025-03-14) is the same as the value of the 'corresponding Anchored VWAPs'.
Main sections of the filter are those named OHLC4 and Moving-VWAP NN .... NOTE: I used OHLC4 for the typical price, but that can be easily changed as wanted.
Just for clarity: I'm just a beginner / learner, not trading at present. So carefully check the code and be aware of the limitations above described and maybe others that I was not able to identify. I checked the results of the filter on TradingView charts and, when data allows, it works, but ...
Thanks in advance for any observations and suggestions on how to improve the filter, on how to chose other 'important' anchoring dates, ...
Cheers from Italy. LP
|
nibor100 1,067 posts msg #161714 - Ignore nibor100 |
3/17/2025 8:34:30 PM
Apparently SFD was delisted from Nasdaq in 2013 when it was bought by a Chinese company, so it has been in business for years, and perhaps SF got some 2024 data from SFD financial reports. There are other dates in Jan 2025 for the first trading day on other sites.
If you want to save some columns you could add Add column market.
Ed S.
|