AVWAP for Daytrading For ThinkOrSwim

justAnotherTrader

Well-known member
VIP
VIP Enthusiast
JK37Ywt.png


Merry Christmas useThinkScripters!

Today I want to introduce a very simple but very effective indicator. It is a custom Anchored VWAP that works based off a specific time.

The question this indicator answers is simple, are buyers mostly underwater or profitable based off the most recent rally. If buyers are mostly underwater, they are going to tend to want to get out and more likely to sell off the next rally. Pretty simple.

Likewise, if most traders are profitable, they will be more likely to defend dips and push rallies. Again, simple stuff.

The simplicity of this indicator is what makes it so powerful. Its not going to tell you whether or not to buy or sell, just whether or not market participants will be willing to support your thesis.

Code:
#
# Anchored VWAP (Exact Date + Time)
#

@Date
input beginDate = 20251215;     # YYYYMMDD
input beginTime = 1030;        # HHmm (24-hour clock, e.g. 0930 = open, 1600 = close)

def curDate = GetYYYYMMDD();
def seconds = SecondsFromTime(beginTime);

def isDate = curDate == beginDate;
def isStart = isDate and seconds >= 0 and seconds[1] < 0;

rec volumeSum =
    if isStart then volume
    else if curDate > beginDate or (isDate and seconds > 0)
         then CompoundValue(1, volumeSum[1] + volume, Double.NaN)
         else Double.NaN;

rec volumeVwapSum =
    if isStart then volume * vwap
    else if curDate > beginDate or (isDate and seconds > 0)
         then CompoundValue(1, volumeVwapSum[1] + volume * vwap, Double.NaN)
         else Double.NaN;

plot AVWAP = volumeVwapSum / volumeSum;
AVWAP.SetDefaultColor(GetColor(0));
AVWAP.SetLineWeight(2);
 

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