Intraday VWAP Reversion Indicator for ThinkorSwim

BenTen

BenTen

Administrative
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
# 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);
 
Y

yman

New 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:
S

skyler1101

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

BenTen

Administrative
Staff
VIP
@skyler1101 Can you post a screenshot of the error message?
 
inthefutures

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

BenTen

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

Top