How to detect a certain percentage of change from the high/low of a study?

Mr_Wheeler

Active member
I was wondering if you could detect percentage change from a high/low point of a study's trend? Let's say there's a 10 percent drop from the top or a 10 percent bounce from a low. It would be nice to send an alert. In fact I found a Jim Cramer Sound board Sfx collection.
 
I was wondering if you could detect percentage change from a high/low point of a study's trend? Let's say there's a 10 percent drop from the top or a 10 percent bounce from a low. It would be nice to send an alert. In fact I found a Jim Cramer Sound board Sfx collection.

the question is too vague.
what defines a trend?
how often to look for peaks and valleys(pivots)? a day, week, the whole chart?

once a peak is found, the high of that candle could be saved , until the next peak comes along and that new peak high is saved.

here is somethung to compare to peaks
untested

Code:
def peak = ... true/false formula

def peakhigh = if peak then high else peakhigh[1];
def diff = close - peakhigh;
def diffper =  round(100*diff/peakhigh,1);
input per = 10;
def dostuff = absvalue(diffper) > per;
addlabel(dostuff, "big move", color.cyan);
#
 
the question is too vague.
what defines a trend?
how often to look for peaks and valleys(pivots)? a day, week, the whole chart?

once a peak is found, the high of that candle could be saved , until the next peak comes along and that new peak high is saved.

here is somethung to compare to peaks
untested

Code:
def peak = ... true/false formula

def peakhigh = if peak then high else peakhigh[1];
def diff = close - peakhigh;
def diffper =  round(100*diff/peakhigh,1);
input per = 10;
def dostuff = absvalue(diffper) > per;
addlabel(dostuff, "big move", color.cyan);
#

Hi @halcyonguy

I was trying to make a label of similar sort when I saw this post. Tried it but did not work.

Basically my aim was:
1. Daily aggregation of current price which is down from a previous peak
2. Find the highest peak from the past 50 days.
3. Calculate the percentage difference between the two; label.

Tried the code above, but it seems the 1st/2nd lines are broken. Tried fixing them but failed.

Thanks in advanced.
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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