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 was really surprised to find that Ninatrader 64bit on Windows 8 will recognize voice commands (through a microphone).
I have been able to push the buttons on Chart Trader (by speaking " Buy Market" , " Sell Bid", "push F3", et cetera), "Switch (to) Control Panel", and all sorts of cool things. It is not perfect, and not everything can be clicked or selected, but it is a great start!
However it it not quite good enough for production trading (in my opinion). I want to have tighter control over the commands (very specific commands not to be confused with other NT controls / buttons) and then potentially train Windows Voice Recognition for only a small set of these types of commands.
I found some code that might possibly work if it was able to be integrated into an indicator. The Ninja C# is not a problem for me (finally), but I"m not a deep C# coder, so perhaps there is a C# whiz who could get the voice recognition code into the Ninja indicator framework.
this particular code looks elegant...(from that web page), though I don't understand it...any way to get this in a Ninja Indicator? Thanks!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using MyApp.SpeechMethods;
namespace MyApp
{
class Program
{
static void Main(string[] args)
{ var methods = new MySpeechMethods();
MethodInfo myMethod;
myMethod = SpeechFactory.GetSpeechMethod("Time Please");
myMethod.Invoke(methods, null);
myMethod = SpeechFactory.GetSpeechMethod("Volume Down");
myMethod.Invoke(methods, null);
myMethod = SpeechFactory.GetSpeechMethod("Volume Up");
myMethod.Invoke(methods, null);
}
}
public static class SpeechFactory
{
private static Dictionary<string, MethodInfo> speechMethods = new Dictionary<string, MethodInfo>();
public static MethodInfo GetSpeechMethod(string speechText)
{
MethodInfo methodInfo;
var mySpeechMethods = new MySpeechMethods();
if (speechMethods.Count == 0)
{
var methodNames =
typeof (MySpeechMethods).GetMethods(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance);
var speechAttributeMethods = methodNames.Where(y => y.GetCustomAttributes().OfType<SpeechAttribute>().Any());
foreach (var speechAttributeMethod in speechAttributeMethods)
{
foreach (var attribute in speechAttributeMethod.GetCustomAttributes(true))
{
speechMethods.Add(((SpeechAttribute)attribute).SpeechValue, speechAttributeMethod);
}
}
methodInfo = speechMethods[speechText];
}
else
{
methodInfo = speechMethods[speechText];
}
return methodInfo;
}
}
}
namespace MyApp.SpeechMethods
{
public class MySpeechMethods
{
[Speech("Time Please")]
[Speech("Whats the Time")]
[Speech("What Time is it")]
public void GetTime()
{
Console.WriteLine(DateTime.Now.ToLocalTime());
}
[Speech("Volume Down")]
public void VolumeDown()
{
Console.WriteLine("Volume Down 1");
}
[Speech("Volume Up")]
public void VolumeUp()
{
Console.WriteLine("Volume Up 1");
}
}
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple = true)]
public class SpeechAttribute : System.Attribute
{
public string SpeechValue { get; set; }
public SpeechAttribute(string textValue)
{
this.SpeechValue = textValue;
}
}
Can you help answer these questions from other members on NexusFi?
Yes, it seems to be a global ability. I used the wrong word "Enabled".... it has nothing to do with Ninja. (However it seems Ninja could clean up the internal labels to give more accuracy for voice commands).
But I would like to create my own custom vice commands for Ninja.
For example to speak "Go Short at 102.5" This would use the selected ATM and place the order at that price.
When you speak "Close" there are two Closes, one for the window and one on Chart Trader to close a position. So, then you cannot simply say Close, you have to say Close and then tell speech recognition which Close to press.
If you have a multi instrument chart with TF on it, and also another single instrument chart with TF. You cannot just say "Switch TF", you have to say "Switch TF" and then tell it which chart to go to.
Or, to select a certain ATM: "Select ATM MyATM"
So, for me while the voice recognition is cool, it is not good enough for live trading. It could be made Ninja specific and smarter with an indicator that processed specific non-window commands.
....the code above seems elegant and concise, but I don't know how to get it into an indicator.