Is there a way to send key stroke from MC

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

Is there a way to send key stroke from MC

Postby arjfca » 09 Dec 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: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 124 times

Re: Is there a way to send key stroke from MC

Postby evdl » 10 Dec 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 514 times


Return to “MultiCharts”