# Intraday VWAP Reversion Indicator for ThinkorSwim

#### BenTen

Staff member
Staff
VIP
Mean reversion strategy which lets you set a VWAP length, ATR length - then creates signal when distance closing price from VWAP is greater than ATR x a multiplier which you set

I would suggest using this on intraday chart only. Timeframes between 5m to 15m would work. But feel free to test it out on your own and choose what's best for you.

### thinkScript Code

Code:
``````# VWAP ATR mean reeeeeeeeee
# Assembled by BenTen at useThinkScript.com

## calculate period-based VWAP

input cumulativePeriod = 24;

def typicalPrice = (high + low + close) / 3;
def typicalPriceVolume = typicalPrice * volume;
def cumulativeTypicalPriceVolume = sum(typicalPriceVolume, cumulativePeriod);
def cumulativeVolume = sum(volume, cumulativePeriod);
def vwapValue = cumulativeTypicalPriceVolume / cumulativeVolume;

## set criteria for ATR distance from VWAP

input trulength = 12;  # ATR Length
def vwop = vwapValue;
def tru = atr(trulength);

input ATRMulti = 4; # ATR Multiple
def long = (vwop-close) > tru* ATRMulti;
def short = (close-vwop) > tru* ATRMulti;

plot sell = short;
sell.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sell.AssignValueColor(color.red);``````

@BenTen is there any way to turn this into a scanner also is there any scanner when price touches yesterday vwap for reversal play?

Last edited:
@BenTen I have no idea why but any time copy your script or even follow a direct link I can't get them to work on my think or swim.... I've grabbed a few other peoples on here they work great I have no idea why yours won't show up for me is there something I'm doing wrong or any suggestions ? I really wanted your trend reversal to work can't get it tried this VWAP same thing won't work

@skyler1101 Can you post a screenshot of the error message?

Do these signals lag or repaint?

interesting study, Question, if running on a intra day time frame why have a look back on the vwap other than the days start?

@inthefutures Good question, I just converted it based on the original script from TradingView. Do you recommend a different setting?

i set mine to RTH open, and or to new swing high or swing low

@BenTen For some reason I cannot get the arrows to display. I copied the script and I see the code in there for the arrows but they do not display. Thanks

@BenTen For some reason I cannot get the arrows to display. I copied the script and I see the code in there for the arrows but they do not display. Thanks
The green up arrow is a rare unicorn. Red arrows are also rare, just not as rare. You should be able to find them on all timeframes, if you load enough history.

If you want to ensure that you loaded the study correctly.
Look at \$BRO on the 5D5m chart. You should see these down arrows:

Last edited:
I would suggest using this on intraday chart only. Timeframes between 5m to 15m would work. But feel free to test it out on your own and choose what's best for you.

### thinkScript Code

Code:
``````# VWAP ATR mean reeeeeeeeee
# Assembled by BenTen at useThinkScript.com

## calculate period-based VWAP

input cumulativePeriod = 24;

def typicalPrice = (high + low + close) / 3;
def typicalPriceVolume = typicalPrice * volume;
def cumulativeTypicalPriceVolume = sum(typicalPriceVolume, cumulativePeriod);
def cumulativeVolume = sum(volume, cumulativePeriod);
def vwapValue = cumulativeTypicalPriceVolume / cumulativeVolume;

## set criteria for ATR distance from VWAP

input trulength = 12;  # ATR Length
def vwop = vwapValue;
def tru = atr(trulength);

input ATRMulti = 4; # ATR Multiple
def long = (vwop-close) > tru* ATRMulti;
def short = (close-vwop) > tru* ATRMulti;

plot sell = short;
sell.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sell.AssignValueColor(color.red);``````
Are these signals basically when it bounces off vwap?

@Nari2007
This is not plotting an arrow triggered by a bounce off VWAP. The arrow, as I understand it, is plotting once the close has reached a distance from the volume weighted average price that is equal to a multiple of the average true range that you specify.

87k+ Posts
354 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?