Is there a way to send key stroke from MC

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: Nov 23 2010
Has thanked: 725 times
Been thanked: 223 times

Dec 09 2015

Hello

Is there a way to emulate key stroke using MC? Will look to send key combination to activate an AutoHotKey command.

Martin

evdl
Posts: 401
Joined: Jan 19 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 125 times

Dec 10 2015

Hello Martin,

Maybe you can use the ShellExecute function.

Make an exe or bat file with AutoHotKey of the actions you want AutoHotKey to take. Let's name it SendKeyStroke.bat. Place this in a directory of your choice, but for the example in C:\

Then make an indicator with the trigger code to open the exe or bat file.

And use this:

Code: Select all

//Your trigger code in PLE, for example:
If close > close[1]
then begin
once ShellExecute("open", "C:\SendKeyStroke.bat");
end;
The indicator will run the .bat or exe file and the AutoHotKey program will take your required actions.

Import the attached function first (this is supplied sometime ago by MC in another post)
Attachments
ShellExecute.pla
(2.97 KiB) Downloaded 539 times