RelativeStrength makes new high

malone1020

Member
VIP
I'm looking for the standard Relative Strength line lower study to make a new high where price does not, but I want to code in an arrow to show where this occurs on the lower study. Any idea what that might look like?

Also, when trying to scan, that 2nd line says it's an invalid statement:

def study2 = RelativeStrength makes new high;

Any ideas? Thanks again, XeoNox!
 
Last edited by a moderator:
I'm looking for the standard Relative Strength line lower study to make a new high where price does not, but I want to code in an arrow to show where this occurs on the lower study. Any idea what that might look like?

Also, when trying to scan, that 2nd line says it's an invalid statement:

def study2 = RelativeStrength makes new high;

Any ideas? Thanks again, XeoNox!

you didnt specify when relative volume makes a new high, so i assumed you meant in the same day.
the code below rarely triggers, so i left out the first study of new high but price does not. if you want to include the first study simply change
plot greenArrow = hhBar;
to
plot greenArrow = hhBar and study1;

Code:
declare lower;
input Opentime1 = 0930;
input Endtime1 = 1600;
def ActiveTime = if GetLastDay() == GetDay() and SecondsFromTime(Opentime1) >= 0 and SecondsFromTime(Endtime1) < 0 then 1 else 0;
input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;
def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
plot RelVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);
def study1 = close is less than high within 8 bars;
plot highestrelvolofday  = highestall(if GetLastDay() == GetDay() and highestall(relvol) then (relvol) else double.nan);
def hhBar = if relvol==highestrelvolofday then BarNumber() else hhBar[1];
plot scan = hhbar;
RelVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RelVol.SetLineWeight(3);
RelVol.DefineColor("Above", GetColor(0));
RelVol.DefineColor("Below", GetColor(2));
RelVol.AssignValueColor(if RelVol >= numDev then RelVol.Color("Above") else RelVol.Color("Below"));
plot greenArrow = hhBar;
greenArrow.SetDefaultColor(Color.GREEN);
greenArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
 

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

you didnt specify when relative volume makes a new high, so i assumed you meant in the same day.
the code below rarely triggers, so i left out the first study of new high but price does not. if you want to include the first study simply change
plot greenArrow = hhBar;
to
plot greenArrow = hhBar and study1;

Code:
declare lower;
input Opentime1 = 0930;
input Endtime1 = 1600;
def ActiveTime = if GetLastDay() == GetDay() and SecondsFromTime(Opentime1) >= 0 and SecondsFromTime(Endtime1) < 0 then 1 else 0;
input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;
def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
plot RelVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);
def study1 = close is less than high within 8 bars;
plot highestrelvolofday  = highestall(if GetLastDay() == GetDay() and highestall(relvol) then (relvol) else double.nan);
def hhBar = if relvol==highestrelvolofday then BarNumber() else hhBar[1];
plot scan = hhbar;
RelVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RelVol.SetLineWeight(3);
RelVol.DefineColor("Above", GetColor(0));
RelVol.DefineColor("Below", GetColor(2));
RelVol.AssignValueColor(if RelVol >= numDev then RelVol.Color("Above") else RelVol.Color("Below"));
plot greenArrow = hhBar;
greenArrow.SetDefaultColor(Color.GREEN);
greenArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
Ha, appreciate the response, but you read Relative Volume where I wrote Relative Strength. Any chance you would be able to take a shot at this? As always, very much appreciated.
 
"Relative Strength line lower study to make a new high where price does not,"
new high as defined would mean the Relative strength would never go down and would only record higher numbers (new highs) meaning it would only go up to infinite, therefore your scan theory although possible would never trigger unless it a newly listed asset.
 
"Relative Strength line lower study to make a new high where price does not,"
new high as defined would mean the Relative strength would never go down and would only record higher numbers (new highs) meaning it would only go up to infinite, therefore your scan theory although possible would never trigger unless it a newly listed asset.
There are many stocks that exhibit new RS line highs where price is consolidating (i.e., "not making a new high"), and some do multiple times a year. It's a leading indicator for a stock to make a move up in the near-term. Anyway, I hope you grasp that and don't mind providing the code logic for it! Your willingness to help UTS members ver and over is incredibly admirable...thank you.
 
I'm looking for the standard Relative Strength line lower study to make a new high where price does not, but I want to code in an arrow to show where this occurs on the lower study. Any idea what that might look like?

Also, when trying to scan, that 2nd line says it's an invalid statement:

def study2 = RelativeStrength makes new high;

Any ideas? Thanks again, XeoNox!

here is what you wanted.

Relative Strength makes a new high and price less than the high

Code:
close is less than high within 8 bars and RelativeStrength()."RS" is greater than RelativeStrength()."RS" from 1 bars ago
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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