need help removing extra arrows

DAB721

New member
I am new to thinkscript I was wondering if someone could help
once one green arrow is printed how do I stop printing another green arrow until after a
red arrow is printed here is that part of the script if you need the rest let me know

input show_output_dot = yes;

def outup = (s1ok and s1up) + (s2ok and s2up) + (s3ok and s3up) + (s4ok and s4up) + (s5ok and s5up);
def outdwn = (s1ok and s1dwn) + (s2ok and s2dwn) + (s3ok and s3dwn) + (s4ok and s4dwn) + (s5ok and s5dwn);

plot zz1 = if show_output_dot and ((outup == cntok) or (outdwn == cntok)) then high * (1 + (1 * vert)) else na;
zz1.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
zz1.SetLineWeight(3);
zz1.AssignValueColor(if (outup == cntok) then Color.GREEN else if (outdwn == cntok) then Color.RED else Color.GRAY);
zz1.HideBubble();
 

Attachments

  • Screenshot 2023-07-08 002233.png
    Screenshot 2023-07-08 002233.png
    53 KB · Views: 182
Solution
I am new to thinkscript I was wondering if someone could help
once one green arrow is printed how do I stop printing another green arrow until after a
red arrow is printed here is that part of the script if you need the rest let me know

input show_output_dot = yes;

def outup = (s1ok and s1up) + (s2ok and s2up) + (s3ok and s3up) + (s4ok and s4up) + (s5ok and s5up);
def outdwn = (s1ok and s1dwn) + (s2ok and s2dwn) + (s3ok and s3dwn) + (s4ok and s4dwn) + (s5ok and s5dwn);

plot zz1 = if show_output_dot and ((outup == cntok) or (outdwn == cntok)) then high * (1 + (1 * vert)) else na;
zz1.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
zz1.SetLineWeight(3);
zz1.AssignValueColor(if (outup == cntok) then Color.GREEN else if (outdwn...
I am new to thinkscript I was wondering if someone could help
once one green arrow is printed how do I stop printing another green arrow until after a
red arrow is printed here is that part of the script if you need the rest let me know

input show_output_dot = yes;

def outup = (s1ok and s1up) + (s2ok and s2up) + (s3ok and s3up) + (s4ok and s4up) + (s5ok and s5up);
def outdwn = (s1ok and s1dwn) + (s2ok and s2dwn) + (s3ok and s3dwn) + (s4ok and s4dwn) + (s5ok and s5dwn);

plot zz1 = if show_output_dot and ((outup == cntok) or (outdwn == cntok)) then high * (1 + (1 * vert)) else na;
zz1.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
zz1.SetLineWeight(3);
zz1.AssignValueColor(if (outup == cntok) then Color.GREEN else if (outdwn == cntok) then Color.RED else Color.GRAY);
zz1.HideBubble();

This example might help. It is one way to limit the arrows as you want.

The image shows multiple arrows for plots up/dn in the same direction.
The plots arrowup/arrowdn limits the arrow plots when there is a change in direction/

Screenshot 2023-07-23 103345.jpg
Code:
#need help removing extra arrows

def ema8  = ExpAverage(close, 8);
def ema21 = ExpAverage(close, 21);

#Multiple arrows in one direction
plot up = if ema8 > ema21 then low else Double.NaN;
plot dn = if ema8 < ema21 then high else Double.NaN;
up.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
dn.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

#One arrow in each direction until a reversal arrow in the opposite direction
def cond = if ema8 crosses above ema21 then 1 else if ema8 crosses below ema21 then -1 else cond[1];
plot arrowup = cond[1] != 1 and cond == 1;
arrowup.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
arrowup.setlineweight(5);

plot arrowdn = cond[1] != -1 and cond == -1;
arrowdn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_down);
arrowdn.setlineWeight(5);

#
 

Attachments

  • Screenshot 2023-07-23 095153.jpg
    Screenshot 2023-07-23 095153.jpg
    92.4 KB · Views: 180
Solution

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
440 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