Volume Profile Indicator & POCs For ThinkOrSwim

Click on the gear icon next to your indicator's name and adjust the settings of the Volume Profile indicator.
Yeah I tinkered with the settings.
It is how I know the volume profile they posted is a custom and not TOS default volume profile.
Somehow, they are able to have expansion volume profile of the chart added to the "no" "on expansion" chart.
Chnging the gear icon settings won't show the "cumulative" chart volume profile on the right axis and ALSO show each volume profile for each date.
 
Settings: Price per row: Ticksize, Time: Chart, On Expansion: Yes

This shows the cumulative for the chart but then the DAILY volume profile for each day disappears???

The question is how do I script to have both work on the same chart.

Day (no expansion) + Chart (yes) Expansion = same chart

baKbf4O.png
 
Last edited:
@jngy2k Have you tried placing two volume profile studies on the same chart? Just set the expansion to 'no' on one and to 'yes' on the other.
 
Anyway to turn off the volume subgraph and just plot the POC and VAhigh, VAlow? Like just the red POC box and the 2 lines
 
Last edited:
Does anyone have a custom study where I can plot the volume profiles? I understand I can change the time per profile but I want to be able to plot the zones on specific candles on my chart.

For instance, I would like to plot a volume profile only on these candles.

cyfLU2z.png


Thanks!
 
@BeakedFish There is an indicator that can create support and resistance zones based on high volume i believe, if this helps.

Code:
#A nice indicator to play with. See notes below.
#Using volume to determine significant areas of support / resistance on intra-day charts.
#This indicator will work on 5 minute charts or below. The green boxes show the major areas
#from the morning sessions; gray boxes are from the mid-day session; and yellow boxes are from
#the late-afternoon session. The gray lines are the significant areas from the previous day.

def Today = if getday() == getlastday() then 1 else 0;

# Split the day into three trading blocks
def block1 = if SecondsFromTime(0930) >= 0 and SecondsTillTime(1100) > 0 then 1 else 0;
def block2 = if SecondsFromTime(1100) >= 0 and SecondsTillTime(1400) > 0 then 1 else 0;
def block3 = if SecondsFromTime(1400) >= 0 and SecondsTillTime(1600) > 0 then 1 else 0;

def startBlock1 = if block1 and !block1[1] then 1 else 0;
def startBlock2 = if block2 and !block2[1] then 1 else 0;
def startBlock3 = if block3 and !block3[1] then 1 else 0;

# Determine the first bar of the day
def nMinutes = GetAggregationPeriod() / 60000;
def nBars = RoundUp(390 / nMinutes, 0);
def FirstBar = if (BarNumber() - 1) % nBars == 0 then 1 else 0;

# Determine day number
def dayNumber = 1 + RoundDown((BarNumber() - 1) / nBars, 0);

# Track volume in each session block
def vol1 = if !block1 then 0 else if block1 and volume(period="5 min" ) > vol1[1] then volume(period="5 min" ) else vol1[1];
def vol2 = if !block2 then 0 else if block2 and volume(period="5 min" ) > vol2[1] then volume(period="5 min" ) else vol2[1];
def vol3 = if !block3 then 0 else if block3 and volume(period="5 min" ) > vol3[1] then volume(period="5 min" ) else vol3[1];

# Determine high / low for each block
def HighB1 = if startBlock1 then high(period="5 min" ) else if block1 and volume(period="5 min" ) > vol1[1] then high(period="5 min" ) else HighB1[1];
def LowB1 = if startBlock1 then low(period="5 min" ) else if block1 and volume(period="5 min" ) > vol1[1] then low(period="5 min" ) else LowB1[1];
def HighB2 = if startBlock2 then high(period="5 min" ) else if block2 and volume(period="5 min" ) > vol2[1] then high(period="5 min" ) else HighB2[1];
def LowB2 = if startBlock2 then low(period="5 min" ) else if block2 and volume(period="5 min" ) > vol2[1] then low(period="5 min" ) else LowB2[1];
def HighB3 = if startBlock3 then high(period="5 min" ) else if block3 and volume(period="5 min" ) > vol3[1] then high(period="5 min" ) else HighB3[1];
def LowB3 = if startBlock3 then low(period="5 min" ) else if block3 and volume(period="5 min" ) > vol3[1] then low(period="5 min" ) else LowB3[1];

# Plot today's data
plot hb1 = HighB1;
plot lb1 = LowB1;
plot hb2 = if block1 and dayNumber == 1 then Double.NaN else HighB2;
plot lb2 = if block1 and dayNumber == 1 then Double.NaN else LowB2;
plot hb3 = if (block1 or block2) and dayNumber == 1 then Double.NaN else HighB3;
plot lb3 = if (block1 or block2) and dayNumber == 1 then Double.NaN else LowB3;

hb1.SetHiding(1);
hb2.SetHiding(1);
hb3.SetHiding(1);
lb1.SetHiding(1);
lb2.SetHiding(1);
lb3.SetHiding(1);

# Color between the lines
def chb1 = if  hb1 == hb1[-1] then hb1 else double.nan;
def chb2 = if  !block1 and hb2 == hb2[-1] then hb2 else double.nan;
def chb3 = if  block3 and hb3 == hb3[-1] then hb3 else double.nan;
AddCloud(chb1, lb1, color.light_green);
AddCloud(chb2, lb2, color.white);
AddCloud(chb3, lb3, color.yellow);

# Plot yesterday's data
def hb2_1 = if daynumber == 1 then double.nan else if firstbar then highb1[1] else hb2_1[1];
def lb2_1 = if daynumber == 1 then double.nan else if firstbar then lowb1[1] else lb2_1[1];
def hb2_2 = if daynumber ==1 then double.nan else if firstbar then highb2[1] else hb2_2[1];
def lb2_2 = if daynumber == 1 then double.nan else if firstbar then lowb2[1] else lb2_2[1];
def hb2_3 = if daynumber ==1 then double.nan else if firstbar then highb3[1] else hb2_3[1];
def lb2_3 = if daynumber == 1 then double.nan else if firstbar then lowb3[1] else lb2_3[1];

plot l1 = hb2_1;
plot l2 = lb2_1;
plot l3 = hb2_2;
plot l4 = lb2_2;
plot l5 = hb2_3;
plot l6 = lb2_3;

l1.setdefaultColor(color.light_gray);
l2.setdefaultcolor(color.light_gray);
l3.setdefaultcolor(color.light_gray);
l4.setdefaultcolor(color.light_gray);
l5.setdefaultcolor(color.light_gray);
l6.setdefaultcolor(color.light_gray);
l1.setpaintingStrategy(paintingStrategy.HORIZONTAL);
l2.setpaintingStrategy(paintingStrategy.HORIZONTAL);
l3.setpaintingStrategy(paintingStrategy.HORIZONTAL);
l4.setpaintingStrategy(paintingStrategy.HORIZONTAL);
l5.setpaintingStrategy(paintingStrategy.HORIZONTAL);
l6.setpaintingStrategy(paintingStrategy.HORIZONTAL);
 
Last edited by a moderator:
Hello, and thank you for posting this wonderful code! I was trying to write it myself, had some hiccups, and I got something to work but I had to manually adjust the bar lookback every day since I clearly wasn't taking the right approach. This one does the trick!

HOWEVER: I have one major caveat. When I run this code on MONTHLY under Marketwatch->Quotes in order to screen VAH, POC, VAL for a defined watchlist, I am not getting accurate results. They are completely, completely different from the graphical results.

Could anyone have a workaround for this problem? Again, the code is perfect for charts but not for the Marketwatch->Quotes screen. Would be super awesome to be able to screen for securities trading below last month's VAL, for example. THANK YOU IN ADVANCE!
 
Hi everyone.

I'm wanting to place two bands (one slightly above, one slightly below) around the weekly volume point of control for a backtest.

Is this possible? thank you.

p.s I'm new, love the forum.
 
Can someone help me? I'm looking for the below

So basically the current day's value areas = 70% of where the trading occurred from the previous day.
And the current day's plotted poc = yesterday's poc.

And I'd like this to not just be an indicator for that specific trading day, but to also go back multiple days in the past. All while having that 1 day delay.

vahvalll.png


Here's a pic, but this obviously doesn't have the POC
 
Last edited:
@Pumper Did you look 3 posts above your own? Isn't that exactly what that code is?
So I used your code that you tagged rloh in, but as you can see in my screenshot below, it only plots yesterday's VAH / VAL on the current day. I would like to have this go back several days, not just have one instance of it. Is that something fairly easy that you could add?

valll.png
 
@Pumper There probably aren't enough data points to properly calculate that first instance... Many indicators suffer the same consequences, even moving averages... While a mild annoyance, it's nothing to worry about... You can increase the lookback time period of your chart, if needed, but the issue will always remain present...
 
One last thing. if you take a look at my screenshot notice they very first instance. For some reason it doesn't plot properly. Doesn't matter if it's a 5 day chart, 10 day, 20 day, etc. The very first instance always plots the indicator weird like that. Any idea why?

valll.png
I believe it's because of how ThinkScript pulls its data. The study itself relies on data from the previous day yet you aren't displaying the previous day on your chart - does that make sense?
 

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
160 Online
Create Post

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