VWAP Price Tug Histogram for ThinkorSwim

Status
Not open for further replies.

Welkin

Active member
The author of the study isn't available on the forum to provide answers to questions. So this thread has been locked.

I didn't know what to name this indicator so I simply called it the VWAP tug. This modeled after something I've noticed in relation to VWAP and strong opens as well as small changes in VWAP over time with trends and the way price "tugs" or pulls the vwap in its direction. What this does is calculates the percentage difference in the VWAP value of the current bar with the prior bar, and repeating this with the next two prior bars so:

VWAP[1] / VWAP,
VWAP[2] / VWAP[1]
VWAP[3] / VWAP[2]

These are then averaged together and plotted as a histogram. Also added a paintbars feature to it.

Code:
#[email protected]

declare lower;

input Paintbars = no;

def VWAP0 = VWAP();

plot TUG1 = 100 - ((VWAP0[1] / VWAP0)*100);
plot TUG2 = 100 - ((VWAP0[2] / VWAP0[1])*100);
plot TUG3 = 100 - ((VWAP0[3] / VWAP0[2])*100);

plot zeroline = 0;

TUG1.Hide();
TUG2.Hide();
TUG3.Hide();

plot TUGAVG = (TUG1 + TUG2 + TUG3) / 3;

zeroline.SetDefaultColor(Color.Gray);

TUGAVG.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
TUGAVG.SetLineWeight(2);
TUGAVG.DefineColor("Positive and Up", Color.GREEN);
TUGAVG.DefineColor("Positive and Down", Color.DARK_GREEN);
TUGAVG.DefineColor("Negative and Down", Color.RED);
TUGAVG.DefineColor("Negative and Up", Color.DARK_RED);
TUGAVG.AssignValueColor(if TUGAVG >= 0 then if TUGAVG > TUGAVG[1] then TUGAVG.color("Positive and Up") else TUGAVG.color("Positive and Down") else if TUGAVG < TUGAVG[1] then TUGAVG.color("Negative and Down") else TUGAVG.color("Negative and Up"));

AssignPriceColor(if !paintbars then Color.CURRENT else if TUGAVG >= 0 then if TUGAVG > TUGAVG[1] then color.GREEN else  color.DARK_GREEN else if TUGAVG < TUGAVG[1] then color.RED else  color.DARK_RED);

TUG1.SetDefaultColor(Color.White);
TUG2.SetDefaultColor(Color.Dark_Orange);
TUG3.SetDefaultColor(Color.Red);
https://tos.mx/HnhvEcU
UiB3ORu.png
 
Last edited by a moderator:
This is rad! Have you thought about making a Supertrend of the price tug for the candle coloring or is that what you already kind of did?
 
This is rad! Have you thought about making a Supertrend of the price tug for the candle coloring or is that what you already kind of did?
I've tried all kinds of indicators for indicating trends and reversals, and I have thought of making some sort of 'supertrend' but i just find myself constantly going back to heiken ashi trend and a 12 period hull moving average, those two seem to be the most consistent trend indicators IMO. This was one of the first scripts I made and figured I'd put it up here incase someone else found some use for it or used it as a building block for something even cooler.
 
@Welkin what products and timeframes, do you trade? What are your go to indicators other than the ones you just mentioned?
I am by no means an expert trader, I just pay the bills, not driving a yacht yet.

I used to trade forex, now i just trade stocks and options, focusing on ETF's such as spy, qqq, etc.. or hedge contracts on vix. I like those more than hunting down individual stocks, though i still look for opportunities in those, its not my priority. I primarily day trade on 5 min time frame. Instead of going lower to 1 min/3min/etc.. I'll use a 5 tick range chart to get a better look at patterns forming (wedges, triangles, flags, etc..), better see what the price action is telling me. Its also a nice way to see when volatility strikes because the grid that divides time on the x axis will widen showing bursts of activity with lots of ticks. Of course I also look at 30 min, 195 min, Hour, Daily with monthly vwap deviation bands, and the Weekly so I get an idea of whats happening in the bigger picture.

as for other indicators, like i said above i like using 12 period hull ma and painting candles as heiken ashi for trend. I also like using RSI Laguerre https://tos.mx/fYxPN9H which I found in the onenote archive, combined with the OBV histogram i scripted, they seem to align in the right ways for good signals. MACD with defaults. I also use a market internals indicator such as $tick, $pcall ratio, breadth ratio, and advance decline. https://tos.mx/mSaOjui if you wanna look at that, I threw it together based other indicators I've seen. Though I haven't seen anyone plot $tick the same way. Labels for ATR, ADR, ADX, Implied Volatility, Avg Daily Vol, Day's Volume, Avg Bar Volume.

Sometimes I'll also bring out Volume Profile and mark Points of Control, Value Areas, or Low/High volume nodes.

Oh and fib extensions for those times when there is no chart history to fall back on.

edit: though this isn't an indicator exactly, I consider it important and trade around it, and that is 30 min market intervals. lots of reversals and pivots tend to happen at 30ish min intervals.... just look at spy on a 5 min and put a vertical line every 30 mins from market open going back a few days and you'll see what I mean.
another edit: I also use an indicator that plots the prior day's high low and close onto the current day https://tos.mx/ktysxlZ
 
Last edited:
Thanks for the info, we have similar styles and use a lot of the same indicators/ideas. Things I use that you don't include the cumulative delta indicator that was posted on this site, and the SMI and TMO studies that have been posted here. (If you feel like normalizing the TMO and plotting cumulative delta on the 50% line as a histogram I would love to see that as one study). I also am trying out various RSI studies with Fractal Pivots and some modified DMI studies. Also been playing around with Diazlaz's CSA (combinded signal approach) study. Let me know if you want to check out any of those if you can't find them on here.

BTW, that internals chart is great!
 
Great thread, great indicators. Stumbling on stuff like this makes all the time spent digging worth it.
 
The author of the study isn't available on the forum to provide answers to questions. So this thread has been locked.
 
Last edited:
Status
Not open for further replies.

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