help on rvol arrow and label script

Code:
def length = 5;
def offset = 1;
def ADV = Average(volume, length)[offset] ;
def rVol = volume / ADV;

def rVNb = 2.3;

def rVolAb2 = rVol >= rVNb ;

AddLabel( rVol);

# draw arrows

Hi please help with some coding on this.

I'm using this on 1minute chart,
so want the chart to put label of current relative volume (rVol) , the background color of the label in LIGHT_GRAY if the rVol is below 2.3, the background color label in GREEN if the rVol above 2.3 .

and also put an arrow if the rVol equal or above 2.3.
the arrows to disappear after 1 day.

thanks a lot !
 
Solution
Code:
def length = 5;
def offset = 1;
def ADV = Average(volume, length)[offset] ;
def rVol = volume / ADV;

def rVNb = 2.3;

def rVolAb2 = rVol >= rVNb ;

AddLabel( rVol);

# draw arrows

Hi please help with some coding on this.

I'm using this on 1minute chart,
so want the chart to put label of current relative volume (rVol) , the background color of the label in LIGHT_GRAY if the rVol is below 2.3, the background color label in GREEN if the rVol above 2.3 .

and also put an arrow if the rVol equal or above 2.3.
the arrows to disappear after 1 day.

thanks a lot !

See if this helps

Ruby:
def length = 5;
def offset = 1;
def ADV = Average(volume, length)[offset] ;
def rVol = volume / ADV;
def rVNb = 2.3;

plot rVolAb2 = if getday() ==...
Code:
def length = 5;
def offset = 1;
def ADV = Average(volume, length)[offset] ;
def rVol = volume / ADV;

def rVNb = 2.3;

def rVolAb2 = rVol >= rVNb ;

AddLabel( rVol);

# draw arrows

Hi please help with some coding on this.

I'm using this on 1minute chart,
so want the chart to put label of current relative volume (rVol) , the background color of the label in LIGHT_GRAY if the rVol is below 2.3, the background color label in GREEN if the rVol above 2.3 .

and also put an arrow if the rVol equal or above 2.3.
the arrows to disappear after 1 day.

thanks a lot !

See if this helps

Ruby:
def length = 5;
def offset = 1;
def ADV = Average(volume, length)[offset] ;
def rVol = volume / ADV;
def rVNb = 2.3;

plot rVolAb2 = if getday() == getlastday() and rVol >= rVNb then low else double.nan ;
rvolAb2.setpaintingStrategy(paintingStrategy.ARROW_UP);
rvolAb2.setdefaultColor(color.green);

AddLabel(1, rVol, if rVol >= rVNb then color.green else color.light_gray);
Screenshot-2022-12-23-040642.png
 
Solution

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

See if this helps
thanks looking good.
I'm thinking if it's possible to add a rVol bubble on the arrow, I will take a look and see which rVol fit best ?
i add in the "rVol :"

and
can i know i tried to change the code
Code:
plot rVolAb2 = if getday() == getlastday() and rVol >= rVNb then low else double.nan ;

#change to 
plot rVolAb2 = if getday() <=3 and rVol >= rVNb then low else double.nan ;
I thought it would produce arrow for the past 3 days. can i know what's the correct code actually?

Code:
def length = 5;
def offset = 1;
def ADV = Average(volume, length)[offset] ;
def rVol = volume / ADV;
def rVNb = 2.3;

plot rVolAb2 = if getday() == getlastday() and rVol >= rVNb then low else double.nan ;
rvolAb2.setpaintingStrategy(paintingStrategy.ARROW_UP);
rvolAb2.setdefaultColor(color.green);

AddLabel(1,"rVol: " + rVol, if rVol >= rVNb then color.green else color.light_gray);

thanks a lot!
 
thanks looking good.
I'm thinking if it's possible to add a rVol bubble on the arrow, I will take a look and see which rVol fit best ?
i add in the "rVol :"

and
can i know i tried to change the code
Code:
plot rVolAb2 = if getday() == getlastday() and rVol >= rVNb then low else double.nan ;

#change to
plot rVolAb2 = if getday() <=3 and rVol >= rVNb then low else double.nan ;
I thought it would produce arrow for the past 3 days. can i know what's the correct code actually?

Code:
def length = 5;
def offset = 1;
def ADV = Average(volume, length)[offset] ;
def rVol = volume / ADV;
def rVNb = 2.3;

plot rVolAb2 = if getday() == getlastday() and rVol >= rVNb then low else double.nan ;
rvolAb2.setpaintingStrategy(paintingStrategy.ARROW_UP);
rvolAb2.setdefaultColor(color.green);

AddLabel(1,"rVol: " + rVol, if rVol >= rVNb then color.green else color.light_gray);

thanks a lot!

Try this

Screenshot-2022-12-23-063141.png
Ruby:
input additional_days_to_show = 2;
def length = 5;
def offset = 1;
def ADV = Average(volume, length)[offset] ;
def rVol = volume / ADV;
def rVNb = 2.3;

input showarrows = no;
plot rVolAb2 = if Between(GetDay(), GetLastDay() - additional_days_to_show, GetLastDay()) and rVol >= rVNb then low else Double.NaN ;
rVolAb2.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
rVolAb2.SetDefaultColor(Color.GREEN);
rVolAb2.SetHiding(!showarrows);

input showlabel = yes;
AddLabel(showlabel, rVol, if rVol >= rVNb then Color.GREEN else Color.LIGHT_GRAY);

input showbubble = yes;
AddChartBubble(showbubble and rVolAb2, low, "rvol:\n" + Round(rVol, 1), Color.GREEN, no);
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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