VWAP Volume Breakout Indicator for ThinkorSwim

@Ben - I have this alert set. Wondering how this scanner missed KODK ticker symbol today. I checked my message center and I don't see any alert getting generated for KODK.
 
Here is the modified code -

Code:
def VWAP = vwap();        # Changed this from plot to def  and commented out bearish plot at the end as well as the scanner can only have one plot for creating watch list

#plot UpperBand = price + numDevUp * deviation;
#plot LowerBand = price + numDevDn * deviation;

#VWAP.setDefaultColor(getColor(0));

# Start Volume
input length = 20;
def Vol = volume;
def VolAvg = Average(volume, length);

def above_volume = Vol crosses above VolAvg;
def bullish_vwap = close crosses above VWAP;

plot bull = above_volume and bullish_vwap;
bull.AssignValueColor(Color.CYAN);
bull.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

#def bearish_vwap = close crosses below VWAP;
#plot bear = above_volume and bearish_vwap;
#bear.AssignValueColor(Color.CYAN);
#bear.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
 
Hey @BenTen
I'm seeing a similar issue. I can see signals for this indicator on SPY's 5 min chart. I created a wishlist with just SPY in it and setup a custom scan as shown in this video (updating a few plots to def like above). Scan says "No matching results".
 
Ah I can see the scan results after setting "within 500" bars instead of 1. I guess since it's after hours now, setting to 500 looked back at bars 2500 mins ago.
Let me try the scan tomorrow morning during trading hours!
 
I still cannot get the alerts to go off. The indicator is out there. I have a couple watchlists. Any idea why i would not alert on the arrows from a particular watchlist? This such a useful tool but you have to be on a stock to see the arrow. I would love if someone could show me how to set up the alert on a watchlist to sound off when a bull/bear arrow is placed on the chart. Anyone?
 
@godfreym No, this type of alerts will only work if you're currently looking at the chart.

If you want to get alerted for multiple stocks, you need to create a scanner > save the watchlist as a scanner > select the option "Alerts when scan results change..."

rQniffK.png
 
Hi, can someone help with a custom indicator and use it on scanner for the following conditions.

1. Alert when stock bounces off vwap and the first candlestick is closed above vwap

2. Alert when stock bounces off vwap and the first candlestick is closed below vwap

3. Alert when stock crosses vwap and the first candlestick is closed above vwap

4. Alert when stock crosses vwap and the first candlestick is closed below vwap

* All these only should be sent as alert when Volume Avg (10) is experiencing at least 25%

* To the end of each indicator, I need Fibonacci EXTENSION auto plotted so I know target take profits.

- The Fibonacci extension values are the 100%, 138.2% ,161.8% and 261.8%
 
@UsDollarClub A lot of the requests you posted can be done by using the condition wizard in ThinkorSwim. No coding experience needed.

Example: Alert when stock crosses vwap and the first candlestick is closed above vwap

He2kFcd.png
 
@BenTen

First of all, love the indicator and have been using it for a while now. Thanks very much for it. I have a question on it as to why it triggers sometimes but not others? See example below. It's pretty common for it to not trigger when conditions have been met and I'm just wondering if you know why and if that could potentially be fixed. The only adjustment I've made to your code in my application is changing the arrow from cyan to orange and adding the alerts.
 
@RichSprinkles Actually, I found the reason. It was due to the condition below:

Code:
def above_volume = Vol crosses above VolAvg;

I changed it to:

Code:
def above_volume = Vol > VolAvg;

And that seems to fix the issue. Recheck the code in the first post. I just updated it.
 
@BenTen Yeah that totally fixes it. Great find and thanks a lot. Interesting how the crosses function doesn't work every time as it's essentially the same idea as greater than.
 
Hello Ben, All - Hope all is well. For the VWAP volume break out indicator. Would it be possible to add the criteria of the stock price and the VWAP being over the 200 MovAvgExponential value?? The idea is that the crossover signals would only bet triggered if the original criteria were met as well as the stock price and VWAP were over this 200 MovAvgExponential value. The premise is that the smaller time frame chart one looks at (3 minutes in my case) would have to be in an uptrend of sorts (above the 200 MovAvgExponential) value to trigger. Right now I can simulate the same by displaying the 200 EMA in the chart and just following my own guidelines criteria once a signal is triggered Or are you or one of the more savvy transcripts are just able to provide the scripting for it to add to the existing VWAP Volume Break Out indicator. Thanks for all your support. Victor.
 
@victorfvm Sure, that is possible. See the modified code below.

Up arrows are visible only if the candle crossing above VWAP has abnormal volume and the stock is currently above 200 EMA.

Code:
# VWAP Breakout Above Average Volume
# Assembled by BenTen at useThinkScript.com

input price_EMA = close;
input length_EMA = 200;
input displace_EMA = 0;
def AvgExp = ExpAverage(price_EMA[-displace_EMA], length_EMA);
def condition_ema = close > AvgExp;

# Start VWAP
input numDevDn = -2.0;
input numDevUp = 2.0;
input timeFrame = {default DAY, WEEK, MONTH};

def cap = getAggregationPeriod();
def errorInAggregation =
    timeFrame == timeFrame.DAY and cap >= AggregationPeriod.WEEK or
    timeFrame == timeFrame.WEEK and cap >= AggregationPeriod.MONTH;
assert(!errorInAggregation, "timeFrame should be not less than current chart aggregation period");

def yyyyMmDd = getYyyyMmDd();
def periodIndx;
switch (timeFrame) {
case DAY:
    periodIndx = yyyyMmDd;
case WEEK:
    periodIndx = Floor((daysFromDate(first(yyyyMmDd)) + getDayOfWeek(first(yyyyMmDd))) / 7);
case MONTH:
    periodIndx = roundDown(yyyyMmDd / 100, 0);
}
def isPeriodRolled = compoundValue(1, periodIndx != periodIndx[1], yes);

def volumeSum;
def volumeVwapSum;
def volumeVwap2Sum;

if (isPeriodRolled) {
    volumeSum = volume;
    volumeVwapSum = volume * vwap;
    volumeVwap2Sum = volume * Sqr(vwap);
} else {
    volumeSum = compoundValue(1, volumeSum[1] + volume, volume);
    volumeVwapSum = compoundValue(1, volumeVwapSum[1] + volume * vwap, volume * vwap);
    volumeVwap2Sum = compoundValue(1, volumeVwap2Sum[1] + volume * Sqr(vwap), volume * Sqr(vwap));
}
def price = volumeVwapSum / volumeSum;
def deviation = Sqrt(Max(volumeVwap2Sum / volumeSum - Sqr(price), 0));

plot VWAP = price;
#plot UpperBand = price + numDevUp * deviation;
#plot LowerBand = price + numDevDn * deviation;

VWAP.setDefaultColor(getColor(0));

# Start Volume
input length = 20;
def Vol = volume;
def VolAvg = Average(volume, length);

def above_volume = Vol > VolAvg;
def bullish_vwap = close crosses above VWAP;

plot bull = above_volume and bullish_vwap and condition_ema;
bull.AssignValueColor(Color.CYAN);
bull.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

def bearish_vwap = close crosses below VWAP;
plot bear = above_volume and bearish_vwap;
bear.AssignValueColor(Color.CYAN);
bear.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
 
Hi Everyone,
New here and love it--two questions-what is the difference between the ascending and descending option on think or swim, does it mean looking for stocks in that pattern?
Lastly, where do I turn in extended hours in the scanner?
Thanks for any feedback
 
How do you disable extended hours on the scanner?
oh just seeing this--I do not know how to disable it on the scanner, I even called TD and they said it was not an option to do so but I know you said it was and you know more than they do-lol. Also, what time frame should we use for this? I read somewhere on here that you said it works with what ever time frame you want, did I read that wrong?
 

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
238 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