VWAP Boulevard Indicator (Request)

AlexsOptions

New member
If you're uncertain of what exactly "VWAP Boulevard" refers to here is the idea

I am very new to thinkscript, not so much new to programming but have been having some troubles with 'scanning' back through the previous bars in order to find high volume days ( volume > 30day avg.) and was wondering if anyone has some insight or even a script that does something similar that I could attempt to modify.

Below is a script that shows the previous day's VWAP which I would believe should be easy to add another check for a higher than avg volume on that day. Just unsure of exactly how to do so.

Code:
#
# Plot Previous Days VWAP
# By XeoNoX via https://usethinkscript.com/
#

input numDevDn = -4.0;
input numDevUp = 4.0;
input timeFrame = {default DAY, WEEK, MONTH};

def cap = GetAggregationPeriod();
def errorInAggregation =
    timeFrame == timeFrame.DAY and cap >= AggregationPeriod.WEEK or
    timeFrame == timeFrame.WEEK and cap >= AggregationPeriod.MONTH;
Assert(!errorInAggregation, "timeFrame should be not less than current chart aggregation period");

def yyyyMmDd = GetYYYYMMDD();
def periodIndx;
switch (timeFrame) {
case DAY:
    periodIndx = yyyyMmDd;
case WEEK:
    periodIndx = Floor((DaysFromDate(First(yyyyMmDd)) + GetDayOfWeek(First(yyyyMmDd))) / 7);
case MONTH:
    periodIndx = RoundDown(yyyyMmDd / 100, 0);
}
def isPeriodRolled = CompoundValue(1, periodIndx != periodIndx[1], yes);

def volumeSum;
def volumeVwapSum;
def volumeVwap2Sum;

if (isPeriodRolled) {
    volumeSum = volume;
    volumeVwapSum = volume * vwap;
    volumeVwap2Sum = volume * Sqr(vwap);
} else {
    volumeSum = CompoundValue(1, volumeSum[1] + volume, volume);
    volumeVwapSum = CompoundValue(1, volumeVwapSum[1] + volume * vwap, volume * vwap);
    volumeVwap2Sum = CompoundValue(1, volumeVwap2Sum[1] + volume * Sqr(vwap), volume * Sqr(vwap));
}
def price = volumeVwapSum / volumeSum;
def deviation = Sqrt(Max(volumeVwap2Sum / volumeSum - Sqr(price), 0));

plot VWAP = price;
def UpperBand = price + numDevUp * deviation;
def LowerBand = price + numDevDn * deviation;


input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLastPeriod = no;
plot PrevDayVWAP;
if showOnlyLastPeriod and !IsNaN(vwap(period = aggregationPeriod)[-1]) {
    PrevDayVWAP = Double.NaN;
} else if volume(period = aggregationPeriod) > VolumeAvg(30) {
    PrevDayVWAP = Highest(vwap(period = aggregationPeriod)[-displace], length);
} else
{
    PrevDayVWAP = Double.NaN;

}
PrevDayVWAP.SetDefaultColor(GetColor(9));
PrevDayVWAP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);


Thanks in advance,

AlexsOptions
 
Last edited:

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

Thread starter Similar threads Forum Replies Date
T VWAP MA Trades -1st 2hrs Questions 0
S Close greater than VWAP ETH Questions 2
W Advanced VWAP Questions 8
Z Moving Average Cross When Above VWAP Questions 1
P Prior Day VWAP Questions 3

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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