# Can someone help me with modifying TOS's Double Smoothed Stochastic?

#### 51smoker

##### New member
I like its DSS indicator, however, i don't know how to change it to fits my needs. I'd like to draw two horizontal lines, 25 and 75, dash lines and color gray. Also, if the area between the 25 and the bottom of the curve (so is the 75 and the top of the curve) can be colored.
Original indicator formula:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2023
#

declare lower;

input rLength = 9;
input sLength = 5;
input length = 10;

def divisor = ExpAverage(ExpAverage(Highest(high, length) - Lowest(low, length), sLength), rLength);

plot DSS = if divisor == 0 then 0 else 100 * ExpAverage(ExpAverage(close - Lowest(low , length), sLength), rLength) / divisor;
DSS.SetDefaultColor(GetColor(8));

Solution
I like its DSS indicator, however, i don't know how to change it to fits my needs. I'd like to draw two horizontal lines, 25 and 75, dash lines and color gray. Also, if the area between the 25 and the bottom of the curve (so is the 75 and the top of the curve) can be colored.
Original indicator formula:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2023
#

declare lower;

input rLength = 9;
input sLength = 5;
input length = 10;

def divisor = ExpAverage(ExpAverage(Highest(high, length) - Lowest(low, length), sLength), rLength);

plot DSS = if divisor == 0 then 0 else 100 * ExpAverage(ExpAverage(close - Lowest(low , length), sLength), rLength) / divisor;
DSS.SetDefaultColor(GetColor(8));

Try this

Code:
``````#
# TD...``````
I like its DSS indicator, however, i don't know how to change it to fits my needs. I'd like to draw two horizontal lines, 25 and 75, dash lines and color gray. Also, if the area between the 25 and the bottom of the curve (so is the 75 and the top of the curve) can be colored.
Original indicator formula:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2023
#

declare lower;

input rLength = 9;
input sLength = 5;
input length = 10;

def divisor = ExpAverage(ExpAverage(Highest(high, length) - Lowest(low, length), sLength), rLength);

plot DSS = if divisor == 0 then 0 else 100 * ExpAverage(ExpAverage(close - Lowest(low , length), sLength), rLength) / divisor;
DSS.SetDefaultColor(GetColor(8));

Try this

Code:
``````#
# TD Ameritrade IP Company, Inc. (c) 2007-2023
#

declare lower;

input rLength = 9;
input sLength = 5;
input length = 10;

def divisor = ExpAverage(ExpAverage(Highest(high, length) - Lowest(low, length), sLength), rLength);

plot DSS = if divisor == 0 then 0 else 100 * ExpAverage(ExpAverage(close - Lowest(low , length), sLength), rLength) / divisor;
DSS.SetDefaultColor(GetColor(8));

plot line25 = 25;
plot line75 = 75;
line25.SetPaintingStrategy(PaintingStrategy.DASHES);
line75.SetPaintingStrategy(PaintingStrategy.DASHES);
line25.SetDefaultColor(Color.GRAY);
line75.SetDefaultColor(Color.GRAY);
AddCloud(100, line75, Color.GREEN, Color.GREEN);
AddCloud(line25, 0, Color.RED, Color.RED);

#``````

### Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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