# TOS indicator "WeaknessInAStrongTrend"

#### Kapitalk12

##### New member
can someone tell me if the study "WeaknessInAStrongTrend" on thinkorswim platform repaints? This is study provided by thinkorswim

Solution
can someone tell me if the study "WeaknessInAStrongTrend" on thinkorswim platform repaints? This is study provided by thinkorswim

No, it does not repaint.
It is a simple Moving Average ROC:
Ruby:
``````# ToS WeaknessInAStrongTrend
# TD Ameritrade IP Company, Inc. (c) 2012-2023
#

input price = close;
input length = 21;
input averageType = AverageType.EXPONENTIAL;

def avg = MovingAverage(averageType, price, length);
def down = price <= price[1];
def up = price >= price[1];

plot LongSignal = sum(down, 3) == 3 and avg > avg[1];
plot ShortSignal = sum(up, 3) == 3 and avg < avg[1];

LongSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
LongSignal.DefineColor("Three Down", GetColor(8));
LongSignal.DefineColor("Four Down"...``````
can someone tell me if the study "WeaknessInAStrongTrend" on thinkorswim platform repaints? This is study provided by thinkorswim

No, it does not repaint.
It is a simple Moving Average ROC:
Ruby:
``````# ToS WeaknessInAStrongTrend
# TD Ameritrade IP Company, Inc. (c) 2012-2023
#

input price = close;
input length = 21;
input averageType = AverageType.EXPONENTIAL;

def avg = MovingAverage(averageType, price, length);
def down = price <= price[1];
def up = price >= price[1];

plot LongSignal = sum(down, 3) == 3 and avg > avg[1];
plot ShortSignal = sum(up, 3) == 3 and avg < avg[1];

LongSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
LongSignal.DefineColor("Three Down", GetColor(8));
LongSignal.DefineColor("Four Down", GetColor(6));
LongSignal.AssignValueColor(if down[3] then LongSignal.color("Four Down") else LongSignal.color("Three Down"));
ShortSignal.DefineColor("Three Up", GetColor(2));
ShortSignal.DefineColor("Four Up", GetColor(5));
ShortSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ShortSignal.AssignValueColor(if up[3] then ShortSignal.color("Four Up") else ShortSignal.color("Three Up"));``````

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