# Reduce Number of Down Arrows

#### 8Nick8

##### Active member
2019 Donor
VIP
Hi all, this is my attempt to construct a simple indicator. The code are attached below, the problem i have is too many down white arrows, when the condition is met.

May i request some help from this great community

1. what is the difference when using MovAvgExponential(low, 10) vs MovAvgExponential(close, 10). How does the LOW and CLOSE affect the plot?

2. From the pic, you noticed that there are lots of white down arrows, I would like to see only TWO white down arrows. How to amend this script to only plot TWO white down arrows, max 2, when the condition3_Dwn is met.

Thank you very much

Code:
``````def Trend = MovAvgExponential(low, 10);
plot MA_color = Trend;
MA_color.AssignValueColor(if close > MA_color then color.green else color.red);

#CCI_
input length = 14;
input over_sold = -100;
input over_bought = 100;

def price = close + low + high;
def linDev = LinDev(price, length);
def CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
def ZeroLine = 0;

def condition1u = close > trend;
def condition2u = CCI crosses above over_sold;
plot pUp = condition1u and condition2u;# and trendup;
pUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
pUp.SetLineWeight(5);
pUp.AssignValueColor(Color.bLUE);

#
def condition3_Dwn = close < Trend;
plot Exit = condition3_dwn;
Exit.SetPaintingStrategy(PaintingStrategy.BOOLEAN_Arrow_Down);
Exit.SetLineWeight(1);
Exit.AssignValueColor(Color.WHITE);``````

@BenTen @markos Thanks for all the guidance....really appreciate it.

Last edited by a moderator:
• Low = the candlestick's lowest price.
• Close = the candlestick's closing price.
Yes, both will affect the plot. Normally, we use close in our scripts.

Why do you only want to see 2 arrows? I'm a bit confused.

@BenTen, the reasons why i was considering only two arrows is to avoid having the chart full of down arrows, esp when we get choppy charts. I am not sure what condition statement i can use to only plot only.,..one arrow. I think another alternative is to change the condition to have two moving averages crossover and provide a down arrow for simplicity.

@Nick Just from looking at it, why not try this. Not tested so who knows what you will get.

def condition3d = CCI crosses below over_bought;
plot Exit = condition3_dwn and condition3d;

@Nick Just from looking at it, why not try this. Not tested so who knows what you will get.

def condition3d = CCI crosses below over_bought;
plot Exit = condition3_dwn and condition3d;
Thank you.

87k+ Posts
429 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?