Previous Large Move

a1cturner

Well-known member
Can't seem to figure out how to add an indicator for a previous large move. All I need is the coding to mark any prior move of 10% or more; up or down.

Keep getting an arrow on every candle with every code I try to write.

End goal is to mark every candle that has a large move and then add a label that shows RSI, MACD, Volume Increase, EMA Status, etc. Trying to make it easier to see a pattern.

I think I can handle the label part if I can just get some help coding the initial signal.
 
Solution
Can't seem to figure out how to add an indicator for a previous large move. All I need is the coding to mark any prior move of 10% or more; up or down.

Keep getting an arrow on every candle with every code I try to write.

End goal is to mark every candle that has a large move and then add a label that shows RSI, MACD, Volume Increase, EMA Status, etc. Trying to make it easier to see a pattern.

I think I can handle the label part if I can just get some help coding the initial signal.

EDIT - i accidently pasted in boolean arrows. i deleted the word boolean , in the setpainting...

this will draw an arrow when there is a price change, greater than the set percent. default is 10%.

can pick 1 of 3 types of price changes...
Can't seem to figure out how to add an indicator for a previous large move. All I need is the coding to mark any prior move of 10% or more; up or down.

Keep getting an arrow on every candle with every code I try to write.

End goal is to mark every candle that has a large move and then add a label that shows RSI, MACD, Volume Increase, EMA Status, etc. Trying to make it easier to see a pattern.

I think I can handle the label part if I can just get some help coding the initial signal.

EDIT - i accidently pasted in boolean arrows. i deleted the word boolean , in the setpainting...

this will draw an arrow when there is a price change, greater than the set percent. default is 10%.

can pick 1 of 3 types of price changes,
bar_to_bar_close
open_to_close
low_to_high

a label shows the % and the change type

test bubbles show price and % change amount


Ruby:
# xpercent_move_0

# find 10% move

def bn = barnumber();
def na = double.nan;
input trigger_percent = 10.0;

def isup = open < close;
def isdwn = open > close;

input data_type = { default bar_to_bar_close, open_to_close, low_to_high };

def chg;
def per;
def type;
switch(data_type) {
case bar_to_bar_close:
  chg = if bn ==1 then 0 else close - close[1];
  per = round(100*chg/close[1],1);
  type = 1;
case open_to_close:
  chg = (close - open);
  per = round(100*chg/open, 1);
  type = 2;
case low_to_high:
  chg = if isdwn then (low - high) else (high - low);
  per = round(100*chg/low, 1);
  type = 3;
}

input show_label = yes;
addlabel( show_label, trigger_percent + "% move: " + (
     if data_type == data_type.bar_to_bar_close then "bar to bar close"
else if data_type == data_type.open_to_close then "open to close"
else if data_type == data_type.low_to_high then "low to high"
else "-") , color.yellow);

input show_arrows = yes;
def triggerup = if (show_arrows and per >= trigger_percent) then 1 else 0;
plot up = if triggerup then low else na;
up.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
up.SetDefaultColor(Color.green);
up.SetLineWeight(2);

def triggerdwn = if (show_arrows and per <= -trigger_percent) then 1 else 0;
plot dwn = if triggerdwn then high else na;
dwn.SetPaintingStrategy(PaintingStrategy.ARROW_down);
dwn.SetDefaultColor(Color.red);
dwn.SetLineWeight(2);

input test1_bubbles = yes;
addchartbubble(test1_bubbles and triggerup , low*0.99,
#bn + "\n" +
chg + "\n" +
per + "%"
, color.green, no);

addchartbubble(test1_bubbles and triggerdwn, high*1.01,
#bn + "\n" +
chg + "\n" +
per + "%"
, color.red, yes);
#


this has the bubbles turned on
06cscFc.jpg
 
Last edited:
Solution

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
386 Online
Create Post

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