![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: May 2010
Posts: 10
Thanks: 8
Thanked 0 times in 0 posts
|
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; |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,382
Thanks: 252
Thanked 967 times in 950 posts
|
JC2000, can you please try a $ sign in front of the instrument name for those spot currency symbols?
So, if (Instrument.FullName == "$AUDUSD") .... Thanks,
Bertrand
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Bertrand for this post: |
|
|
|
#3 |
|
Junior Member
Join Date: May 2010
Posts: 10
Thanks: 8
Thanked 0 times in 0 posts
|
I did add the $ in front but still not working
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,774
Thanks: 158
Thanked 564 times in 555 posts
|
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.
Matthew
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Matthew for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |