Intraday VWAP Reversion Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
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.

XgW0izs.png


thinkScript Code

Code:
# VWAP ATR mean reeeeeeeeee
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/eZ3GJvsP-VWAP-ATR-mean-reeeeeeeeee/

## 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 buy = long;
buy.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
buy.AssignValueColor(color.green);
plot sell = short;
sell.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sell.AssignValueColor(color.red);
 

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

@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
 
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?
 
@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:
Cn8j84r.png
 
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.

XgW0izs.png


thinkScript Code

Code:
# VWAP ATR mean reeeeeeeeee
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/eZ3GJvsP-VWAP-ATR-mean-reeeeeeeeee/

## 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 buy = long;
buy.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
buy.AssignValueColor(color.green);
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.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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