• Happy Independence Day! Take $40 off VIP Membership with code JULY4. Sign up here.

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);
 

yman

Member
@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:

skyler1101

New member
VIP
@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
 

inthefutures

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

BenTen

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

jkruse

New member
@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
 

MerryDay

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

Nari2007

Member
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?
 

samport

New member
@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

Top