NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 10-05-2011, 05:10 AM   #1
JC2000
Junior Member
 
Join Date: May 2010
Posts: 10
Thanks: 8
Thanked 0 times in 0 posts
Unhappy Help! when conditions are met,it will draw arrow,text & alert but does not play sound

Help!
this indicator codes are for multi charts:--
when conditions are met,it will draw arrow,text & alert but does not play sound.
I am not sure I got the right instrument names
=============================================
if (Instrument.FullName == "AUDUSD") {PlaySound(@"C:\Program Files(x86)\NinjaTrader7\sounds\AU.wav");} else;
if (Instrument.FullName == "EURJPY") {PlaySound(@"C:\Program Files(x86)\NinjaTrader7\sounds\EJ.wav");} else;

return;
JC2000 is offline  
Reply With Quote
Old 10-05-2011, 05:28 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,382
Thanks: 252
Thanked 967 times in 950 posts
Default

JC2000, can you please try a $ sign in front of the instrument name for those spot currency symbols?

So, if (Instrument.FullName == "$AUDUSD") ....

Thanks,
NinjaTrader_Bertrand is online now  
Reply With Quote
The following user says thank you to NinjaTrader_Bertrand for this post:
Old 10-05-2011, 06:12 PM   #3
JC2000
Junior Member
 
Join Date: May 2010
Posts: 10
Thanks: 8
Thanked 0 times in 0 posts
Default

I did add the $ in front but still not working
JC2000 is offline  
Reply With Quote
Old 10-05-2011, 07:50 PM   #4
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,774
Thanks: 158
Thanked 564 times in 555 posts
Default

JC2000,

I got this to work using if (Instrument.FullName == "$AUDCAD")

If this is set to CaculateOnBarClose == True you're only going to hear the alert at the beginning of each bar. You may want to switch to CalulateOnBarClose == False to ensure that the sound is being triggered.

Also check the Log tab of the Control Center for any errors related to playing these files.
NinjaTrader_Matthew is online now  
Reply With Quote
The following user says thank you to NinjaTrader_Matthew for this post:
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Play sound alert with re-arm period dsfalc General Programming 1 07-08-2011 05:41 AM
Play sound file without Alert? Turtle Trader General Programming 3 02-28-2011 07:57 AM
How to draw text above arrow? jrobert Version 7 Beta General Questions & Bug Reports 1 08-16-2010 04:14 PM
A simple sound/text alert? 5iver Indicator Development 1 11-22-2008 10:24 AM
Play sound to alert order confirmation form AJNIN Suggestions And Feedback 1 06-24-2008 09:21 AM


All times are GMT -6. The time now is 09:16 AM.