Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am starting to play around a little with synthetic voice alerts and found that the Speak method is synchronous and locks the execution thread while it is playing the voice. So, the Ninja script and the Ninja Chart Draw basically stop until the voice is played.
Also, in Synchronous mode, when lots of alerts come quickly, they are queued up and all NT tasks seem to lock up, even on a fast multi thread machine, until the voice synthesizer queue is emptied.
It appears that the Async mode solves this problem. Alerts are not queued and are allowed to speak over each other...which for me is better than queueing up 10 audio alerts in a fast market
You can try this out yourself with the following indicator...just alternately comment out the Speak and SpeakAsync lines....and then run it on a fast moving chart, with fast bars, such as say, a 2 range bar, to push lots of alerts quickly.
Here is some code to play with....
Can you help answer these questions from other members on NexusFi?
Trading: 6C (Low Margin,) 6E, CL, GC, ES and Maybe DX for smaller tick value
Posts: 1,394 since May 2011
Thanks Given: 1,719
Thanks Received: 1,020
@vantojo, would the standard Ninja Trader indicator "Candle Stick Pattern" be a good candidate for synthesis? I use about 2 - 4 pairs of this indicator, Engulfing pairs, Morning Star/Evening Star and others. They do not signal that often and if you were to use a rearm function of perhaps 55 seconds I would think it should not disrupt processing much.
Any chance you would code this with alert stating "doji" type: Bearish Engulfing 6E 2 minute?
That would be awesome. I already have separate Engulfing indicator but it simply says engulfing. Hopefully you could provide at least a first pass at this?
I'm totally focused at the moment on a development project....perhaps another coder can help you? Integrating the voice is easy, as the code above shows...that is all you need to do.
Trading: 6C (Low Margin,) 6E, CL, GC, ES and Maybe DX for smaller tick value
Posts: 1,394 since May 2011
Thanks Given: 1,719
Thanks Received: 1,020
@Tasker_182, Yes, I am tryinng to use COBC = false. The same thing happens to the sample text in post #1 if COBC=False is used.
Any idea what type of statement would apply to have that happen? I tried looking at the "Rearm" statement used for Alerts but it does not look like it applies. I was thinking there might be a "Stop" type statement for voice.
Thought about doing words "" but then I think the syntesis would still be active, just quiet, but still procesing.
Any assistance would be apprecited, Tasker or @vantojo.
This isn't easy on my iPhone but basically you want to test if your condition (whatever it is, is true) in order to speak the words. Using the system variable FirstTickOfBar will only be true once per bar. Saidstuff is your bool variable to mean if words have been or could be spoken. Saidstuff is set false at the beginning of each bar
If your condition is true and saidstuff is false then the words are spoken and then saidstuff is set true so that words won't be spoken until the next bar (and your condition is true).
If (your condition is true)
{
If (FirstTickOfBar) saidstuff = false;
If (!saidstuff)
{
(Speak the words you want to say)
saidstuff = true;
}
}
Be yourself; everyone else is already taken. Oscar Wilde