NexusFi: Find Your Edge


Home Menu

 





Seemingly unsolvable error messages in ThinkorSwim Alerts


Discussion in ThinkOrSwim

Updated
    1. trending_up 3,961 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread

Seemingly unsolvable error messages in ThinkorSwim Alerts

  #1 (permalink)
Txurruka
Cocoa, Florida, United States
 
Posts: 1 since Oct 2010
Thanks Given: 0
Thanks Received: 0

I am new to programming, and I think I understand the code below, I just can't understand why the editor won't accept it.

I copy/pasted the code for MA_Crossover_w_Alerts released by think or swim into the complex alert compiler. Everything is functioning except the alerts portion at the bottom. The following is written:

#Trigger alerts
alert(crossover[1], "Crossover", Alert.Bar, Sound.Ding);
alert(crossunder[1], "Crossunder", Alert.Bar, Sound.Ding);

Every time I paste that in, the scripter creates the error "No such constant: Sound.Ding" I know for a fact that Sound.Ding is a valid constant (it is in the thinkscript manual), I just don't know why it won't acknowedge it. Further, the compiler rejects all “Sound._” constants that are in the manual. I tried to just leave out the sound parameter altogether, since the manual indicates that it will default in that instance to Sound.NoSound, but then it gives me this error: "No default value for parameter 'parameter3' on alert". I talked to someone else that tried the same code in their own TOS program, and he didn't have any of the issues I'm having. He didn't tell me anything beyond that, though, so I'm kind of stuck.

To be clear, the whole script released from Think or Swim is as follows:


input EMAPeriod = 10;
input SMAPeriod = 20;
input price = close;
def na = double.nan;

plot fastema = ExpAverage(price, EMAPeriod);
plot slowema = Average(price, SMAPeriod);
def crossover = if fastema > slowema AND fastema[1] <= slowema[1] then 1 else 0;
def crossunder = if fastema < slowema AND fastema[1] >= slowema[1] then 1 else 0;

#Plot arrows
Plot up = if crossover then low - tickSize() else na;
Plot down = if crossunder then high + tickSize() else na;
up.SetPaintingStrategy(paintingStrategy.ARROW_UP);
down.SetPaintingStrategy(paintingStrategy.ARROW_DOWN);

#Trigger alerts
alert(crossover[1], "Crossover", Alert.Bar, Sound.Ding);
alert(crossunder[1], "Crossunder", Alert.Bar, Sound.Ding);




Thank you for any help you can provide!

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
NexusFi Journal Challenge - April 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
36 thanks
NexusFi site changelog and issues/problem reporting
22 thanks
The Program
20 thanks
GFIs1 1 DAX trade per day journal
19 thanks




Last Updated on October 13, 2010


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts