VWAP Crosses, Format, Watchlist, Label, Scan for ThinkorSwim

Hello. I need some help with this. Im trying to get this custom condition to work but it keeps selling my order before it happens. I want a custom condition that will sell my shares when the current price close gets below VWAP automatically. Im wondering if im using the right VWAP (Studies>VWAP or price> (VWAP)...Thanks.
Most members use the VWAP() function not the VWAP price.
This thread gives you 10 pages of examples:
https://usethinkscript.com/threads/vwap-format-watchlist-label-scan-crosses-for-thinkorswim.110/
 
Hello,

I've looked through the threads and can't seem to find this request, which I thought would be very popular.

I'm looking to add a column on my watchlist that shows when prices crosses VWAP within the last bar only.

  • crosses VWAP, column turns green (or says "X", or something like that)
  • if price has not crossed VWAP within the last bar, it remains blank.
I'm only interested in the crossover - I don't want the indicator to show me if price is above or below VWAP.

Any help would be appreciated!
 
Hello,

I've looked through the threads and can't seem to find this request, which I thought would be very popular.

I'm looking to add a column on my watchlist that shows when prices crosses VWAP within the last bar only.

  • crosses VWAP, column turns green (or says "X", or something like that)
  • if price has not crossed VWAP within the last bar, it remains blank.
I'm only interested in the crossover - I don't want the indicator to show me if price is above or below VWAP.

My thinking was that as long as I get the alert, I can decide to go long, short, or stay pat. But I use VWAP as my main indicator so knowing when my stocks cross it is very beneficial to me.

I then analyze the trend, level 2 data to decide what to do.


Any help would be appreciated!
 
Last edited by a moderator:
I think that you should include some sort of momentum indicator as well. It's one thing to cross-over, it's another to have enough fuel in the trend in order to make a it worth while to do a trade.

Sure a stock may have done a VWAP cross over, but how would you know it's not going bounce back under over or over the VWAP line without another indicator?
 
My thinking was that as long as I get the alert, I can decide to go long, short, or stay pat. But I use VWAP as my main indicator so knowing when my stocks cross it is very beneficial to me.

I then analyze the trend, level 2 data to decide what to do.

Sounds fair. Make sure to use other indicators as well.

I use VWAP & this study that I made.

http://tos.mx/LQAcw4G

Here's my momentum study as seen in the flexible grid.

https://tos.mx/14c4BAL

j4ITHfK.png



O2OvgUg.png
 
Hello,

I've looked through the threads and can't seem to find this request, which I thought would be very popular.

I'm looking to add a column on my watchlist that shows when prices crosses VWAP within the last bar only.

  • crosses VWAP, column turns green (or says "X", or something like that)
  • if price has not crossed VWAP within the last bar, it remains blank.
I'm only interested in the crossover - I don't want the indicator to show me if price is above or below VWAP.

Any help would be appreciated!
Ruby:
#vwap crosses watchlist column
#merryday 3/20/22
def vwapx = reference vwap();
def vwap_cross = low < vwapx and high > vwapx;

AddLabel(yes, " ");
AssignBackgroundColor(if vwap_cross then color.green else color.light_gray);
 
I wanted to quickly know if the stock price is currently above or below VWAP (Volume Weighted Average Price). One of our developers were able to help me put together a watchlist column that shows just that. Here is what it looks like.

Shared WatchList Link: http://tos.mx/X7jLAge Click here for --> Easiest way to load shared links
7P8f0QI.png


Notes:
  • Green means price is currently above VWAP
  • Red means price is currently below VWAP

thinkScript Code

Rich (BB code):
plot vwap = vwap();
AssignBackgroundColor(if close > vwap then Color.DARK_GREEN else if close < vwap then Color.DARK_RED else Color.Dark_ORANGE);

Credit:
  • WalkingBallista
@BenTen Is there a way to have a scan or watchlist column that can alert you when price is approaching vwap, maybe +/- a certain price range away or something like that?
 
Good Morning Everyone.... I have a pretty neat idea for Hull/Vwap Crossover on the 5 minute Chart as a Watchlist Column with Labels and Background Color. I'm new to writing code via thinkscript... I'm running in a road block... I know something is wrong but I am not sure what. Help with this idea to make it a reality would be greatly appreciated :)

Code Concept Thus Far:

input HullMovingAvg = 5

input vwap()

Def Above = hullmovingavg crosses above vwap;

Def Below = hullMovingAvg crosses below vwap;

AddLabel(Above, " Vwap Calls ", color.white);

AddLabel(Below, " Vwap Puts ", color.white);

AssignBackgroundcolor (if Aboveit then color.DARK_GREEN else if Belowit then color.DARK_RED else color.BLACK);
 
Good Morning Everyone.... I have a pretty neat idea for Hull/Vwap Crossover on the 5 minute Chart as a Watchlist Column with Labels and Background Color. I'm new to writing code via thinkscript... I'm running in a road block... I know something is wrong but I am not sure what. Help with this idea to make it a reality would be greatly appreciated :)
Ruby:
# HullMovingAvg VWAP Cross Watchlist
# @MradamsIDF 3/17/22

def length = 21 ;
def Hullma = HullMovingAvg("length" = length) ;
def VWAP   = reference vwap() ;

def Belowit = Hullma crosses below vwap;
def Aboveit = Hullma crosses above vwap;


AddLabel(yes,
    if Aboveit then "Vwap Calls" else
        if Belowit then "Vwap Puts"  else " ");
AssignBackgroundcolor (
    if Aboveit then color.DARK_GREEN else
        if Belowit then color.DARK_RED else color.BLACK);
 
Hey there...On the long side, I like to swing what I call VWAP Bounces where the VWAP is pushed down by shorts but bounces hard to the upside...

Here's an example from $VET (Dec 2021+Jan 2022)

G0OVeT3.png


I'm trying to turn this into a chart indicator but I'm failing pretty miserably...

Here's the script I put together but I'm getting invalid statement errors...Does anyone know what I'm doing wrong?

def VWAP = VWAP;

plot bullish = if (VWAP[2] > VWAP[1] and VWAP > VWAP[1] and VWAP > VWAP[2] then 1 else 0;

plot bearish = if (VWAP[2] < VWAP[1] and VWAP < VWAP[1] and VWAP < VWAP[2] then 1 else 0;

bullish.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Up);

bearish.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Down);

bullish.SetLineWeight(5);

bearish.SetLineWeight(5);
 
Hey there...On the long side, I like to swing what I call VWAP Bounces where the VWAP is pushed down by shorts but bounces hard to the upside...

Here's an example from $VET (Dec 2021+Jan 2022)

G0OVeT3.png


I'm trying to turn this into a chart indicator but I'm failing pretty miserably...

Here's the script I put together but I'm getting invalid statement errors...Does anyone know what I'm doing wrong?

def VWAP = VWAP;

plot bullish = if (VWAP[2] > VWAP[1] and VWAP > VWAP[1] and VWAP > VWAP[2] then 1 else 0;

plot bearish = if (VWAP[2] < VWAP[1] and VWAP < VWAP[1] and VWAP < VWAP[2] then 1 else 0;

bullish.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Up);

bearish.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Down);

bullish.SetLineWeight(5);

bearish.SetLineWeight(5);

There are two vwaps in TOS. One is price and the other is the indicator. The following with the reference VWAP() is the indicator, which I assume you wanted.

Also, you had two '(' at the beginning of bullish and bearish plot statements that were not closed with a ')'.

Ruby:
def VWAP = reference VWAP();

plot bullish = if VWAP[2] > VWAP[1] and VWAP > VWAP[1] and VWAP > VWAP[2] then 1 else 0;

plot bearish = if VWAP[2] < VWAP[1] and VWAP < VWAP[1] and VWAP < VWAP[2] then 1 else 0;

bullish.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Up);

bearish.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Down);

bullish.SetLineWeight(5);

bearish.SetLineWeight(5);
 
Any above or below vwap candle color scripts?
I've got this one for HMA's -

Code:
input Length = 20;
def HMA = HullMovingAvg(Close,Length);
assignPriceColor(
    if Close > HMA then Color.light_gray
    else Color.pink
);
 
Last edited by a moderator:
Is there a way to create a watchlist column that when the price is above VWAP upper band its green and when the price is below VWAP lower band its red and when price is in between its orange??
 
This will find the last 2 bars, not including the last bar, that close above Vwp. If you want to include the last bar as one of the 2 bars, then reduce the values in all the brackets [ ] by 1.
@SleepyZ was playing with this vwap plot so if I wanted to scan only one bar above and one bar below would it be
def vwap = reference vwap();
plot scan = close[-1] < vwap[-1]
plot scan = close[1] > vwap[1]

could I use these conditions together or would they have to b on separate scans?
 
How can I draw a price line when a when the condition is met
Hi, I am working on an indicator and would like to draw a price line (at that level) when the condition is met. The code i have came up so far is as below. Any help to update it is highly appreciated.

declare upper;
def vwap = reference VWAP();
def AvgExp200 = ExpAverage(price[-displace], 9);
if (ema9 crosses above vwap) {
plot pl = price;
pl .SetDefaultColor(Color.green);
pl .HideBubble();
pl .HideTitle();
}
 
Last edited by a moderator:
@SleepyZ was playing with this vwap plot so if I wanted to scan only one bar above and one bar below would it be
def vwap = reference vwap();
plot scan = close[-1] < vwap[-1]
plot scan = close[1] > vwap[1]

could I use these conditions together or would they have to b on separate scans?
Please check this one

def vwap = reference vwap();
plot scan = close[-1] < vwap[-1] and close[1] > vwap[1];

Again, I think crosses above also will also serve the purpose - like below:

def vwap = reference vwap();
plot scan = close crosses above vwap;
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
527 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