volume profile

Clib

New member
Any script that calculates the furthest point to the poc and projects a horizontal line as in the image?

Screenshot_2.png
 
Solution
Any script that calculates the furthest point to the poc and projects a horizontal line as in the image?

View attachment 18938

The image helps explain your prior request, so I think this now does what you want.

The image includes the code below and a volumeprofile indicator.

Screenshot 2023-07-03 090921.png
Code:
profile vol = VolumeProfile(startnewprofile = GetYYYYMMDD() != GetYYYYMMDD()[1], pricePerRow = PricePerRow.TICKSIZE, onExpansion = no, numberOfProfiles = 1);
vol.Show();

def poc  = if IsNaN(vol.GetPointOfControl()) then poc[1] else vol.GetPointOfControl();
def hday = if IsNaN(vol.GetHighest()) then hday[1] else vol.GetHighest();
def lday = if IsNaN(vol.GetLowest())  then lday[1] else vol.GetLowest();

def hdiff = hday - poc;
def ldiff = poc -...
Any script that calculates the furthest point to the poc and projects a horizontal line as in the image?

View attachment 18938

The image helps explain your prior request, so I think this now does what you want.

The image includes the code below and a volumeprofile indicator.

Screenshot 2023-07-03 090921.png
Code:
profile vol = VolumeProfile(startnewprofile = GetYYYYMMDD() != GetYYYYMMDD()[1], pricePerRow = PricePerRow.TICKSIZE, onExpansion = no, numberOfProfiles = 1);
vol.Show();

def poc  = if IsNaN(vol.GetPointOfControl()) then poc[1] else vol.GetPointOfControl();
def hday = if IsNaN(vol.GetHighest()) then hday[1] else vol.GetHighest();
def lday = if IsNaN(vol.GetLowest())  then lday[1] else vol.GetLowest();

def hdiff = hday - poc;
def ldiff = poc - lday;

AddLabel(1, hdiff + " " + poc + " " + ldiff, Color.YELLOW);

def line = if IsNaN(close) then line[1] else if hdiff > ldiff then poc - hdiff else poc + ldiff;
plot extendedline = line;
extendedline.SetPaintingStrategy(PaintingStrategy.DASHES);
 
Solution

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

The image helps explain your prior request, so I think this now does what you want.

The image includes the code below and a volumeprofile indicator.
thank you so much,Is there a way to have it for each volume profile?
 

Attachments

  • Screenshot_2.png
    Screenshot_2.png
    82 KB · Views: 123
thank you so much,Is there a way to have it for each volume profile?


The numberofprofiles in the referenced indicator controls how many will be displayed. I added an input so that you can change this rather than doing it within the code.

Screenshot 2023-08-13 081235.png
Code:
input numberofprofiles_to_display = 20;
profile vol = VolumeProfile(startnewprofile = GetYYYYMMDD() != GetYYYYMMDD()[1], pricePerRow = PricePerRow.TICKSIZE, onExpansion = no, numberOfProfiles = numberofprofiles_to_display);
vol.Show(color = Color.GRAY);

def poc  = if IsNaN(vol.GetPointOfControl()) then poc[1] else vol.GetPointOfControl();
def hday = if IsNaN(vol.GetHighest()) then hday[1] else vol.GetHighest();
def lday = if IsNaN(vol.GetLowest())  then lday[1] else vol.GetLowest();

def hdiff = hday - poc;
def ldiff = poc - lday;

AddLabel(1, hdiff + " " + poc + " " + ldiff, Color.YELLOW);

def line = if IsNaN(close) then line[1] else if hdiff > ldiff then poc - hdiff else poc + ldiff;
plot extendedline = line;
extendedline.SetPaintingStrategy(PaintingStrategy.DASHES);
extendedline.assignvalueColor(if hdiff > ldiff then color.magenTA else color.cyan);
 
The numberofprofiles in the referenced indicator controls how many will be displayed. I added an input so that you can change this rather than doing it within the code.
Thank you very much🥰!!, I was looking for it for months. Is it possible to configure the code so that I can change the colors and options like the one that comes by default?
 

Attachments

  • vp.png
    vp.png
    44 KB · Views: 111

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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