VWAP in a custom Scan filter not returning TRUE

jrandydavis

New member
Plus
Hello-- I've written a custom scan filter that includes the VWAP value, but something must not be correct, as the results (and corresponding scan Alerts) do not match the VWAP criterion in the filter. Everything else on the scanner seems to return TRUE. For example, on a 5 min Agg + EXT, I have in a custom scan filter-- open[1] > average(open, 7)[10] AND volume[1] > 150000 AND close[1] > VWAP()[1]. The filter and Alerts return results that are TRUE for the open[1] and volume[1] equations, but not for the VWAP equation (i.e. shows results where the close from the previous bar is both higher and lower that the VWAP value at that bar). I'm not sure what I'm doing wrong here, any help or insight would be much appreciated. First post here-- let me know if any add'l info is needed.
JRD
 
Most likely, it's using the VWAP fundamental, rather than referencing the VWAP study. You can check this easily. If "VWAP" is turning green in the editor, it's wrong.

def x = reference vwap;
.... and close[1] > x[1]
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Most likely, it's using the VWAP fundamental, rather than referencing the VWAP study. You can check this easily. If "VWAP" is turning green in the editor, it's wrong.

def x = reference vwap;
.... and close[1] > x[1]
Thank you Joshua for the response. As per your reply, I tried--

def x = reference vwap;
close[1] > x[1]

as 2 separate lines of code, both in a custom scan filter, and in a (chart) custom study. TS Editor didn't like the second line in either instance.

Can you tell me more about the VWAP fundamental vs VWAP study data, or where to find more practical (i.e. scan filter-related) info on it? I did read the the ToS Tutorial on VWAP, and did not see mention of the difference. I thought this would be a straightforward data grab, but it's been a headache for a week now with no resolution in sight.
I'm just hoping to find the best/most accurate way to compare the VWAP value to the other $ values on a given chart (open, close, etc.) for use in a scan filter. Even when I make an entry, the Condition Wizard seems to like it format-wise, but clearly I'm not communicating thru code properly to call out the VWAP data/value that I'd like. Thanks for any other insight.
JRD
 
I am a bit rusty, my only experience with VWAP is helping people here. I don't use it myself. Anyway, the formula for VWAP has an input known as "typical price." In every other platform that I know of, as well as every website that hosts the VWAP formula, I recall that the typical price is always HLC3.

TOS, on the other hand, has a VWAP fundamental. This is more akin to other basic price points like Open, Volume, High, Tick Count, and so forth. TOS uses this VWAP fundamental inside of its actual VWAP study in place of HLC3.

https://toslc.thinkorswim.com/center/reference/Tech-Indicators/studies-library/V-Z/VWAP

https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Fundamentals/vwap
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
410 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top