Key event within mq4 programs

 

Hi Codersguru,

I would like an indicator(/EA) that reacts to users' commands: the indicator would do a task upon the striking of "F5", "Ctrl+P", or of any assigned key of my choice:

start

{

...

if ("Key event") function(x1,x2);

...

}

function(x1,x2)

{

...

Print("Hey it's Saturday for goodness sake");

...

}

Is there such a possibility in mql?

Thanks for your help and all your tutorials/tips!

pipeline

 

Good idea!

pipeline:
Hi Codersguru,

I would like an indicator(/EA) that reacts to users' commands: the indicator would do a task upon the striking of "F5", "Ctrl+P", or of any assigned key of my choice:

start

{

...

if ("Key event") function(x1,x2);

...

}

function(x1,x2)

{

...

Print("Hey it's Saturday for goodness sake");

...

}

Is there such a possibility in mql?

Thanks for your help and all your tutorials/tips!

pipeline

pipeline,

This is very good idea! Let me check how could it be done! (of course as c++ dll).

 

Get keyboard keys to MetaTrader!

Hi !

Done sir!

Please give this article a look:

http://www.metatrader.info/node/167

 
 

keyboard input

Is there a function to get user input from the keyboard? I'm just testing entry orders where the user enters the price and the script adds or substracts N number of pips for the stop loss and take profit values.

Thank you.

Metalorn.

 

I moved your post to this thread.

The other 2 threads related to this subject:

https://www.mql5.com/en/forum/176626

https://www.mql5.com/en/forum/178343

 

Close all positions by a single keystroke?

Hi guys

I'm a newbie. I have a question, is there any scripts or tools that allow me to close all my open positions only by a single keyboard stroke?

I've try to browse threads on elite section buy i dont find any tools. Thank you for your help. I really appreciate it.

best regards

sam

 

I am not sure that I understand ...

but also look at this thread https://www.mql5.com/en/forum/178343

And there is scripts and fulle explanation for that on this thread https://www.mql5.com/en/forum/176626

 
Files:
test_hotkey.jpg  91 kb
 
pips4life:
Hi MT4 programming experts,

Over on the MQL4 web site, several people have asked if they could capture keyboard or mouse clicks from within a program. The typical answer is no, and yet I've seen some very clever applications that use a DLL to capture or emulate keyboard events. What I want to do is capture a mouse event, for which I have found no useful MQL4 examples.

...

I assume Newdigital moved my post into this thread... however, I have followed all of the links here and none of them solve my problem.

I need a program to capture a mouse event, not a keyboard event. The two are very different. A keyboard event can be captured to run something as it relates in general to your current chart, such as to open a Buy/Sell at market price. In contrast, a mouse event (i.e. left-mouse click) -- if this problem can be solved -- can capture a specific time & price on your current chart!

Native MT4 commands can do this with ease of course. You can execute a menu command or push an icon, and the program then prompts you to left-mouse-click on whatever spot on your chart you want for your command. I'm looking for a way that I can access this mouse control from within a script (or perhaps by an EA as well).

Still looking for a solution... anyone have any ideas?

Thanks in advance,

Pips4life

 

it works?

Hi Flolks,

I really don't know what the issue!!

My code can handle any hotkey and of course you can set any type of code when the hot key is pressed.

Download the attached indicator and click (ctrl+0) and see.

Regards,

CG

Files:
kb.mq4  5 kb
Reason: