NexusFi: Find Your Edge


Home Menu

 





Seemingly unsolvable error messages in ThinkorSwim Alerts


Discussion in ThinkOrSwim

Updated
    1. trending_up 3,968 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?
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
Cheap historycal L1 data for stocks
Stocks and ETFs
 




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