JoeyVinyl 125 posts msg #151119 - Ignore JoeyVinyl |
3/7/2020 5:35:11 PM
I was watching a video where the person was talking about using only the VWAP and EMA(9) (for day trading - they suggested the SMA(9) for swing trading). I'm still learning as much as I can so I thought I'd check the VWAP out. It seems that SF doesn't have that indicator. A quick forum search showed that TRO had worked on it years ago but his filters are usually too complex for me, mainly because I have to decipher what his set variables are for. I couldn't find any other posts where someone had come up with filter phrases to create it. One of my favorite basic learning tools is Investopedia. Here's where I got the formula I used in this code: https://www.investopedia.com/articles/trading/11/trading-with-vwap-mvwap.asp
THIS IS NOT A COMPLETE FILTER. I want to be clear about that. All I was trying to do here was create a way to see a VWAP. It does have two filter phrases but only so I could make columns to show my set statement results. I took those out, btw. It only goes back five days because you need cumulative numbers and more than five days worth would include too many lines (IMO) and probably trigger the "you need the Advanced SF to run this" message.
My expectation is that if you like what I post here and copy it to your filters that you will modify it to your needs so if you want to use this and add more days to it go right ahead. If you can come up with a way to streamline this please do and let me see it! Or if you see any errors in it I'd like to know about those too.
Having said all that, here's the quick and dirty 5 day VWAP code:
|
Cheese 1,374 posts msg #151120 - Ignore Cheese modified |
3/7/2020 7:25:31 PM
@JoeyVinyl,
You are indeed very clever and I like your "myVWAP" very much.
You may find the following links useful
https://www.tradingview.com/wiki/Volume_Weighted_Average_Price_(VWAP)
https://www.tradingview.com/blog/en/built-in-vwap-is-now-calculated-at-dwm-timeframes-16008/
Thank you for sharing
|
nibor100 1,031 posts msg #151122 - Ignore nibor100 |
3/8/2020 1:24:06 AM
@ JoeyViny
This should be a lot shorter.
Ed S.
|
JoeyVinyl 125 posts msg #151124 - Ignore JoeyVinyl |
3/8/2020 11:56:41 AM
@nibor100
Ed, that's perfect! Thank you!
I have a basic (very basic) understanding of pivot points but haven't looked at them here so this helped me learn the "pp" phrase. I don't think I've ever tried to use sum or avg either, but now I know I can.
I post things in here for two reasons. One, if someone else is trying to do the same thing but having trouble I hope my efforts can help them. And two, so I can learn when someone shows me a better way to do what I'm trying to do. I honestly appreciate all the help.
|
JoeyVinyl 125 posts msg #151126 - Ignore JoeyVinyl |
3/8/2020 12:00:14 PM
@Cheese
Thank you for the links. The more I learn the more I realize this indicator may not be as useful to me as it can be to day traders, but knowledge is rarely a bad thing.
|
omrangassan 6 posts msg #160703 - Ignore omrangassan modified |
12/7/2023 2:39:22 PM
thanks @nibor100 for the idea of Anchored VWAP.
now am trying to build anchored VWAP screener which does the following:
To build a scanner based on Anchored VWAP.
It will check if the current stock price is between 0.98 and 1.02 of its VWAP Price.
Now how to assign the anchoring point for VWAP for any stock ? anchoring point of VWAP will differ for each stock depending on the stock price chart in the last 6 months (or past 1 year or past x days).
the anchoring point of VWAP (the candle date which VWAP will start from) will be the lowest low (or highest high) that stock made in the past x days or past x weeks.
supposing that we are today at day 0 and we chose to scan for past -180 days : so a stock may put the lowest low in day -133 while other stock may put its lowest low in day -66 and so on.
this lowest low (in past x days) will be the anchoring point for VWAP which will anchor VWAP on it for that specific stock, then to proceed to check if current price of that stock is between 0.98 and 1.02 of its VWAP Price.
if we used the function of [Days Since (DAYS)] to find the anchoring point of the VWAP for any stock to be screened so the procedure will be:
1- find the anchoring point to start VWAP from : each stock will have a different anchoring point depending on the lowest low set by that stock in past X days, not all stocks will have a similar anchoring candle to start from.
2- build VWAP for each stock depending on the anchoring point found in #1 above.
3- check if the current price of that stock is between 0.98 and 1.02 of its VWAP Price.
below is a filter I tried to filter but it does not give result : where is the mistake ? may you help me to build it correctly ?
______________________
_________________________
I'll be thankful to get your advice to make it work perfectly.
I'm not sure if am doing it correctly but maybe function varOffset will help ?
|