# Add bell and verital line

#### 123 man

##### New member
Hi guys. Ive tried with out any results so i am reaching out here. Is it possable to have an alert such as a bell and a vertical line added to the TOS SMA momentum ?
Code:
``````declare lower;

input price = close;
input momentumLength = 28;
input smaLength = 28;

assert(momentumLength > 0, "'momentum length' must be positive: " + momentumLength);

plot Momentum = price - price[momentumLength];
plot Avg = Average(data = Momentum, length = smaLength);
plot ZeroLine = 0;

Momentum.SetDefaultColor(GetColor(1));
Avg.SetDefaultColor(GetColor(5));
ZeroLine.SetDefaultColor(GetColor(0));``````

Solution
Hi guys. Ive tried with out any results so i am reaching out here. Is it possable to have an alert such as a bell and a vertical line added to the TOS SMA momentum ?
Code:
``````declare lower;

input price = close;
input momentumLength = 28;
input smaLength = 28;

assert(momentumLength > 0, "'momentum length' must be positive: " + momentumLength);

plot Momentum = price - price[momentumLength];
plot Avg = Average(data = Momentum, length = smaLength);
plot ZeroLine = 0;

Momentum.SetDefaultColor(GetColor(1));
Avg.SetDefaultColor(GetColor(5));
ZeroLine.SetDefaultColor(GetColor(0));``````

you didn't say what conditions you are looking for.
i guessed at using the momentum line crossing the avg line.

Code:
``# sma_momen...``

#### halcyonguy

##### Well-known member
VIP
Hi guys. Ive tried with out any results so i am reaching out here. Is it possable to have an alert such as a bell and a vertical line added to the TOS SMA momentum ?
Code:
``````declare lower;

input price = close;
input momentumLength = 28;
input smaLength = 28;

assert(momentumLength > 0, "'momentum length' must be positive: " + momentumLength);

plot Momentum = price - price[momentumLength];
plot Avg = Average(data = Momentum, length = smaLength);
plot ZeroLine = 0;

Momentum.SetDefaultColor(GetColor(1));
Avg.SetDefaultColor(GetColor(5));
ZeroLine.SetDefaultColor(GetColor(0));``````

you didn't say what conditions you are looking for.
i guessed at using the momentum line crossing the avg line.

Code:
``````# sma_momen

declare lower;

input price = close;
input momentumLength = 28;
input smaLength = 28;

assert(momentumLength > 0, "'momentum length' must be positive: " + momentumLength);

plot Momentum = price - price[momentumLength];
plot Avg = Average(data = Momentum, length = smaLength);
plot ZeroLine = 0;

Momentum.SetDefaultColor(GetColor(1));
Avg.SetDefaultColor(GetColor(5));
ZeroLine.SetDefaultColor(GetColor(0));

#--------------------------

def triggerup = Momentum crosses above avg;
def triggerdwn = Momentum crosses below avg;

# =====================================
# Sound.Ding,  higher , up sound
# Sound.Bell,  lower , down sound

# =====================================

#``````

• 123 man

#### 123 man

##### New member
you didn't say what conditions you are looking for.
i guessed at using the momentum line crossing the avg line.

Code:
``````# sma_momen

declare lower;

input price = close;
input momentumLength = 28;
input smaLength = 28;

assert(momentumLength > 0, "'momentum length' must be positive: " + momentumLength);

plot Momentum = price - price[momentumLength];
plot Avg = Average(data = Momentum, length = smaLength);
plot ZeroLine = 0;

Momentum.SetDefaultColor(GetColor(1));
Avg.SetDefaultColor(GetColor(5));
ZeroLine.SetDefaultColor(GetColor(0));

#--------------------------

def triggerup = Momentum crosses above avg;
def triggerdwn = Momentum crosses below avg;

# =====================================
# Sound.Ding,  higher , up sound
# Sound.Bell,  lower , down sound

# =====================================

#``````
Yep thats the one. Thanks Bud

• halcyonguy

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

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