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)
Objective: have Sierra Chart speak "New Candle" at each new candle
Of course, this is not very useful. But the idea is that the code may be adapted for other uses, as sophisticated alerts.
Important disclaimer. I am a total newbie in C++, .NET, Windows programming, etc. I have solved all my Windows-related problems by Googling. And I am not sure to have understood what I have done. What follows is experimental, may be dirty and non-optimal.If another nexusfi.com (formerly BMT) member wants to improve this solution, she/he shall not hesitate!
1. Open a new solution in Visual C++ with the 40-line code below.
Do not forget to adapt the first line to reflect the exact directory of your sierrachart.h
Do not forget to update the output .DLL directory (as usual)
2. Try to build the solution.
You should obtain the following error message: fatal error C1190: managed targeted code requires a '/clr' option Go to Properties of the solution >> Configuration Properties >> General >> Common Language Runtime Support
Choose "Common Language Runtime Support (/clr)"
Reference : managed targeted code requires a /clr option
3. Try to build the solution.
You should obtain the following error message: Command line error D8016 : '/MT' and '/clr' command-line options are incompatible Go to Properties of the solution >> Configuration Properties >> C++ >> Code Generation >> Runtime Library
Choose "Multi-threaded DLL (/MD)"
References : '/MT' and '/clr' command-line options are incompatible and /MD, /MT, /LD (Use Run-Time Library)
4. Try to build the solution.
You should obtain the following error message: fatal error C1107: could not find assembly 'System.Speech.dll': please specify the assembly search path using /AI or by setting the LIBPATH environment variable Go to Properties of the solution >> Configuration Properties >> C++ >> General >> Resolve #using References
Add the directory of System.Speech.dll
On my computer, this directory is:
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\
Reference: /AI (Specify Metadata Directories) (C++)
5. Try to build the solution: should be OK!
Then add the study "Voice" to your chart, as usual.
You should hear "Hello" once or twice.
And "New candle" at each new candle.