weekly VAH and VAL are inside of the prior weeks

JE $$

Member
I want to do something like this with the weekly volume high and low value areas.
https://usethinkscript.com/threads/previous-day-volume-val-vah-for-thinkorswim.12630/

Can someone please help with this value area scan?
I am trying to create a scan that finds candidates whose weekly VAH and VAL are inside of the prior weeks values.

Specifically:
this weeks VAH is less than last weeks VAH
this weeks VAL is greater than last weeks VAL
(weekly value area inside scan)

I tried using the Value area indicators i can find on here to do it and also the built in TPO indicator but I cant seem to get it to work. I think my inability to get it to work has something to do with all the various time aggregations -- in my attempts I have made sure that the aggregations are aligned but it hasnt helped.
 
Last edited by a moderator:
Solution
I want to do something like this with the weekly volume high and low value areas.
https://usethinkscript.com/threads/previous-day-volume-val-vah-for-thinkorswim.12630/

Can someone please help with this value area scan?
I am trying to create a scan that finds candidates whose weekly VAH and VAL are inside of the prior weeks values.

Specifically:
this weeks VAH is less than last weeks VAH
this weeks VAL is greater than last weeks VAL
(weekly value area inside scan)

I tried using the Value area indicators i can find on here to do it and also the built in TPO indicator but I cant seem to get it to work. I think my inability to get it to work has something to do with all the various time aggregations -- in my attempts I have...
I want to do something like this with the weekly volume high and low value areas.
https://usethinkscript.com/threads/previous-day-volume-val-vah-for-thinkorswim.12630/

Can someone please help with this value area scan?
I am trying to create a scan that finds candidates whose weekly VAH and VAL are inside of the prior weeks values.

Specifically:
this weeks VAH is less than last weeks VAH
this weeks VAL is greater than last weeks VAL
(weekly value area inside scan)

I tried using the Value area indicators i can find on here to do it and also the built in TPO indicator but I cant seem to get it to work. I think my inability to get it to work has something to do with all the various time aggregations -- in my attempts I have made sure that the aggregations are aligned but it hasnt helped.

Here is a modification of a DAY version I previously posted to a WEEK.

The scanner would not accept it. However, you could make it a watchlist column that you can sort. It will be green when the current week is INSIDE of the prior week's VAH/VAL, Make sure you set the custom column and the chart you are viewing to the same timeframe.
Screenshot 2023-08-21 065030.png

Code:
def daysago = 0;# 0 compares today to yesterday; 1 compares yessterday to the day before it; etc....

def vah = reference VolumeProfile("time per profile" = "Week", "on expansion" = no, "price per row height mode" = "TICKSIZE").VAHigh;

def vah0 = if Getweek() == GetLastweek() - daysago then vah else vah0[1];
def vah1 = if Getweek() == GetLastweek() - daysago - 1 then vah else vah1[1];

def val = reference VolumeProfile("time per profile" = "Week", "on expansion" = no, "price per row height mode" = "TICKSIZE").VALow;

def val0 = if Getweek() == GetLastweek() - daysago then val else val0[1];
def val1 = if Getweek() == GetLastweek() - daysago - 1 then val else val1[1];


plot inside = vah1>vah0 and val0>val1;

assignbackgroundColor(if inside then color.green else color.black);

This link has a version for the chart you are viewing. https://tos.mx/1yZKiJN
 
Solution

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

Here is a modification of a DAY version I previously posted to a WEEK.

The scanner would not accept it. However, you could make it a watchlist column that you can sort. It will be green when the current week is INSIDE of the prior week's VAH/VAL, Make sure you set the custom column and the chart you are viewing to the same timeframe.


This link has a version for the chart you are viewing. https://tos.mx/1yZKiJN
@SleepyZ thanks so much for helping with this. I really appreciate you!
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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