stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

MomoTalkerEA - Empty4 Assistive Technology (Speech)
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5054
Page 1 of 1
Author:  DigitalCrypto [ Mon Jan 23, 2017 11:27 pm ]
Post subject:  MomoTalkerEA - Empty4 Assistive Technology (Speech)

Announcing MomoTalker
An Assistive Technology EA

What is it?
MomoTalker is a non-trading EA based on Steve's framework and on work he had done for me about a year ago. He didn't code this EA so if it doesn't work right yell at me. Anyway, using the work as a base I removed all the trading code and logic. I also removed all of the externs to reduce the menu. I then added CodersGuru speech DLL and set to work to write a basic announcer EA for one of our students whom is blind. (Guy is a heck of a trader and determined not to settle with the hand he was recently dealt)

What we do
We teach a style of momentum trading and it is important for students to know which bars have closed higher or lower than the previous bars. We do this on two time frames (usually m15/h1). I figured MomoTalker would be a good way to help one of our new student traders who has difficulty seeing by announcing certain bars when they close.

What it does
When loaded on an M15 chart MomoTalker will announce the last bar status whether it was up, down or inside.

On the hour it should announce the last candle close status as well as speak a reminder of the daily open price.

Why post it?
I know just enough to break something or piss off a developer. I wanted to share my work with folks who may need it and extend an invite to those whom are more creative than I am when it comes to this stuff. I also want to give back to Steve and this group. Thank you for being here

How to install it
The very first thing you need to do is install the speak_b6.dll library from CodersGuru into your Library folder. Then once that has been completed make sure you have Empty4 DLL Imports enabled. Finally load the MomoTalker EA onto a 15M chart. I have made the time frames selectable.

An open note to coders
I won't be offended if you tell me this is complete garbage. I'm a trader first and a coder 100th. By all means don't feel shy to step up to the plate and help with things. I and others would really appreciate it.

Blocking code. While I understand that this is blocking perhaps there may be a better way to pipe text to an external batch file using ShellExecuteW. I know there is a Voice.exe cmd line file out there on the net that is open source. I am open to options on how to make the voice non-blocking etc.



Files
Author:  SteveHopwood [ Mon Jan 23, 2017 11:39 pm ]
Post subject:  MomoTalkerEA - Empty4 Assistive Technology (Speech)

Anybody here able to help, please? This sounds like a Really Good Cause to me.

:xm:
Author:  renexxxx [ Tue Jan 24, 2017 1:10 am ]
Post subject:  MomoTalkerEA - Empty4 Assistive Technology (Speech)

DigitalCrypto » Tue Jan 24, 2017 9:27 am wrote: Blocking code. While I understand that this is blocking perhaps there may be a better way to pipe text to an external batch file using ShellExecuteW. I know there is a Voice.exe cmd line file out there on the net that is open source. I am open to options on how to make the voice non-blocking etc.
The easiest way to make this non-blocking, in my opinion, is to use a "Speaker EA", installed on a separate thread (read: chart), that is listening for "Speaker Events". The main EA just sends a Custom (Speaker) Event to the Speaker EA and carries on with it's other business.

Shout if you need any help with the code for this.

R.
Author:  DigitalCrypto [ Tue Jan 24, 2017 1:25 am ]
Post subject:  MomoTalkerEA - Empty4 Assistive Technology (Speech)

That is a brilliant idea! Would you do it using GVs?

I don't mind doing the work but I'm a bit lost on how the process would flow. I would not mind seeing a basic example of what you are thinking. Particularly the part that I do not understand is if I would set a GV to be read how would I "queue" events to the SpeakerEA?
Author:  renexxxx [ Tue Jan 24, 2017 3:09 am ]
Post subject:  MomoTalkerEA - Empty4 Assistive Technology (Speech)

DigitalCrypto » Tue Jan 24, 2017 11:25 am wrote:That is a brilliant idea! Would you do it using GVs?

I don't mind doing the work but I'm a bit lost on how the process would flow. I would not mind seeing a basic example of what you are thinking. Particularly the part that I do not understand is if I would set a GV to be read how would I "queue" events to the SpeakerEA?
Custom Events are automatically queued by Empty4 and the OnChartEvent() handler will process them in sequence.

See here a modified version of MomoTalker (MomoTalker_mod) with the following changes:

1. Removed the #imported gspeak module (this is now done by the SpeakerEA -- also attached)
2. Added an #include of the Events.mqh file.
3. Modified the Say() function, to BroadCast an EVENT_SPEAK, instead of calling the gSpeak() function inline.

In order to handle the EVENT_SPEAK, the SpeakerEA must be running.

I have also added a tiny SpeakTest script, to prove that the speaking is performed asynchronously. The SpeakTest counts to 10000 and sends a few phrases to the SpeakerEA. Once it is done, it prints "I'm done". You will notice that the SpeakerEA will keep on speaking long after the SpeakTest script has finished running ... (If you want it to "shut up" just remove the SpeakerEA).

Have fun with this.

PS: I have out-commented the #property strict in Events.mqh, in order not to generate a laundry list of compiler warnings from MomoTalker_mod. However, I strongly suggest to make the code in MomoTalker_mod '#property strict' compliant. This compiler directive has been added by MetaQuotes to make your life as a coder easier: it prevents you from creating code that does compile but produces run=time errors and/or memory leaks.
Author:  heart1010 [ Wed Jan 25, 2017 9:38 am ]
Post subject:  MomoTalkerEA - Empty4 Assistive Technology (Speech)

Interesting stuff with this speak_b6.dll library. Thanks for bringing it up here as a working EA :hi: :good:
All times are UTC Page 1 of 1