I have an indicator with if with 7 or 8 else if I have put a sound option in an "else if" but once it is executed, the sound is executed 8 times in a row ... I have tried to put the sound out but when it is executed the same thing happens, how can I break the sound so that a sound is executed? once? if {} else if {} else if { Alert(CurrentBar.ToString(), Priority.High, "Alert4", WAVFileName1, 1, Brushes.White, Brushes.Green);} else if {} if{} .... etc
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Sound if else
Collapse
X
-
Sound if else
I have an indicator with if with 7 or 8 else if I have put a sound option in an "else if" but once it is executed, the sound is executed 8 times in a row ... I have tried to put the sound out but when it is executed the same thing happens, how can I break the sound so that a sound is executed? once? if {} else if {} else if { Alert(CurrentBar.ToString(), Priority.High, "Alert4", WAVFileName1, 1, Brushes.White, Brushes.Green);} else if {} if{} .... etcTags: None
-
Hello anmir55,
Can you provide a larger sample of the logic used to control the alerts?
If you are hearing the sound 8 times that would mean the logic was called 8 times. It sounds like you tried what I would suggest or to move the Alert to another area however I would need to see what you did to understand why that's not working.
I would need to see a more specific example of the syntax to know why it was called more than once.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
-
Originally posted by anmir55 View PostI have an indicator with if with 7 or 8 else if I have put a sound option in an "else if" but once it is executed, the sound is executed 8 times in a row ... I have tried to put the sound out but when it is executed the same thing happens, how can I break the sound so that a sound is executed? once? if {} else if {} else if { Alert(CurrentBar.ToString(), Priority.High, "Alert4", WAVFileName1, 1, Brushes.White, Brushes.Green);} else if {} if{} .... etc
Comment
-
Hello anmir55,
We would need to see more of a sample in this case, I agree with koganam it sounds like from the description your conditions are falling through in some way. From what has been provided I can't really see what may be happening, if you can provide the whole if statement you are using that would help, if that is a large section of code you may need to make a quick sample of your if statement and just include where you use the alert.
I would also suggest using the "A" button at the top of the forums text editor, it will expand options including the "#" for wrapping code, this would be helpful so its not just a long line of text and keeps its spacing/doesn't loose any formatting.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rocketman7, Today, 01:00 AM
|
0 responses
1 view
0 likes
|
Last Post
by rocketman7
Today, 01:00 AM
|
||
Started by wzgy0920, 04-20-2024, 06:09 PM
|
2 responses
27 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:43 PM
|
||
Started by wzgy0920, 02-22-2024, 01:11 AM
|
5 responses
32 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:33 PM
|
||
Started by wzgy0920, 04-23-2024, 09:53 PM
|
2 responses
74 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:29 PM
|
||
Started by Kensonprib, 04-28-2021, 10:11 AM
|
5 responses
193 views
0 likes
|
Last Post
by Hasadafa
Yesterday, 10:19 PM
|
Comment