NexusFi: Find Your Edge


Home Menu

 





Voice commands for Ninja revisited


Discussion in NinjaTrader

Updated
    1. trending_up 2,113 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 2 attachments




 
Search this Thread

Voice commands for Ninja revisited

  #1 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

Ok, guys, I have been able to get an indicator to process voice commands. I've attached the cs file because I have a lot of references for other stuff on my system that probably would stop a zip import on your system.

possibly you might need to install the .NET speech recognition references on your system. At the moment, I don't remember how I did that...

It seems there are just two problems remaining. there are print commands to trace what is happening.

1) the indicator will process the voice command only once. then I have to reload the indicator before it will listen again

2) the indicator is actively listening even if the chart it is on is not in focus....it needs to only listen when the panel/chart it is on is in focus so that it does not process commands when the user is not looking at the chart

Well, if anyone knows how to solve these two items, it seems those of us who want to talk to Ninja instead of having our hand on the mouse, this is one step closer.

A00VoiceCommand.cs

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Quant vue
Trading Reviews and Vendors
Cheap historycal L1 data for stocks
Stocks and ETFs
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
NexusFi Journal Challenge - May 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
75 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
36 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
16 thanks
  #3 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012


I found one solution....this is working to keep it listening

private void RecognizeCompleted(object sender, RecognizeCompletedEventArgs e)
{
listener.RecognizeAsync();
Print (" Completed");
}

now I need to find a way to know when the chart is active .... then I will try to start and stop the listener thread. I'll start the thread when the chart has focus and stop it when the chart looses focus...but so far I'm not having luck with the GOTFOCUS and LOSTFOCUS events for ChartControl.

Started this thread Reply With Quote
  #4 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

ok, this is giving me the change in focus

ChartControl.ChartPanel.GotFocus += new EventHandler (ThisGotFocus);
ChartControl.ChartPanel.LostFocus += new EventHandler (ThisLostFocus);

but, now I'm not sure about starting a Thread (for the voice recognition) inside Ninja, if it is going to cause problems.

Because it seems when I press F5 (to reload the indicator) the existing thread is not terminated and a duplicate is started...not sure but it seems to be this way, and if so this is going to cause problems.

perhaps a C# guru will know.

Thank you.

Started this thread Reply With Quote
  #5 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

Ok, it is now working the way I want...

(.cs attached)

this is skeleton code for command processing...not a finished product...for other coders to play with


the indicator will only process commands when the Chart Panel it is on has focus. This means the indicator can be on many charts and the voice commands will only be processed on the Chart that has focus.

Debug code inside...with Print statments.

Let me know if you find any bugs.

Attached Files
Elite Membership required to download: A000VoiceCommand.cs
Started this thread Reply With Quote




Last Updated on October 5, 2014


© 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