Key event within mq4 programs - page 2

 

I need price & time (of cursor) when hotkey is pressed.

codersguru:
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

Hi CG,

You love a challenge, and I appreciate all the great posts you've shared.

The difficulty I'm having is not simply to detect whether a hotkey (or mouse click) was pressed, but wherewas the cursor at the moment it was pressed, in terms of priceand time? I see no clue in your code (nor anywhere else) that solves this problem.

I want to write a script that places objects in the current window at whatever price & time the cursor is at when the script executes. I don't want to use drag-and-drop of the script onto the chart (because if I did, the solution would be easy, which is "WindowPriceOnDropped" and WindowTimeOnDropped".

The process of locating the script on the Navigator list and drag-and-dropping it is tedious, compared to just pushing a function key on my keyboard. (The Logitech G11 keyboard has 18 programmable G keys, and 3 sets each, so I can have 54 functions). The most obvious first application is rapid Elliott Wave labelling by just pointing with the cursor and pressing a function key. I have plenty of other applications in mind if this "price & time when executed" problem can be solved, so this would really be very useful.

Thanks in advance,

Pips4life

 

Yes this is a big challenge.

Getting the cursor location on the screen is not the problem. The problem is how to translate this location to time and price is the problem.

pips4life:
Hi CG,

You love a challenge, and I appreciate all the great posts you've shared.

The difficulty I'm having is not simply to detect whether a hotkey (or mouse click) was pressed, but wherewas the cursor at the moment it was pressed, in terms of priceand time? I see no clue in your code (nor anywhere else) that solves this problem.

I want to write a script that places objects in the current window at whatever price & time the cursor is at when the script executes. I don't want to use drag-and-drop of the script onto the chart (because if I did, the solution would be easy, which is "WindowPriceOnDropped" and WindowTimeOnDropped".

The process of locating the script on the Navigator list and drag-and-dropping it is tedious, compared to just pushing a function key on my keyboard. (The Logitech G11 keyboard has 18 programmable G keys, and 3 sets each, so I can have 54 functions). The most obvious first application is rapid Elliott Wave labelling by just pointing with the cursor and pressing a function key. I have plenty of other applications in mind if this "price & time when executed" problem can be solved, so this would really be very useful.

Thanks in advance,

Pips4life
 
codersguru:
Yes this is a big challenge. Getting the cursor location on the screen is not the problem. The problem is how to translate this location to time and price is the problem.

I don't know if it is worth the work, but a solution might be to find the sub-window "Data Window" thru some dll and read it (I think its a ListView32 control)

Another idea is to have a small object which follows the pointer and to read its properties

The third idea, maybe the simplest one, is to read the status bar; something like this, from Get the Text of a Statusbar Panel**(Thomas Stutz) an article on delphi3000.com******||

// Example to read the statusbar text of the explorer.exe

procedure TForm1.Timer1Timer(Sender: TObject);

var

hWindow, hStatusBarHandle: HWND;

begin

hWindow := FindWindow('ExploreWClass', nil);

if FensterHandle = 0 then Exit;

hStatusBarHandle := FindWindowEx(hWindow, 0, 'msctls_statusbar32', nil);

label1.Caption := GetStatusBarText(hStatusBarHandle, 2);

end;

 

That's a tough one

I'm thinking that's going to take someone who knows the ins and outs of handling windows mouse events within a custom dll that would then expose them to metatrader via exported functions. It would also need to pass down the "window" the event occured on. There's nothing already available in MT4 that I'm aware of that would make that easy. I agree it would be handy though.

 

HotKeys for MT4 scalping

Scalping need to fast / immediate after fullfilling all the conditions.

Does anybody can programme the HotKey's i.e. B/buy, S/sell and E/exit that will automatically execute the trade after use it upon earlier setting up the parameters ?

Problem starts when one has more then 1 opened trade, so the propo is when the trade is sublighted on the Commerce MT4 bookmark the 'E" key will close this trade what is highlighted.

or maybe someone has already done it or heard it ?

thx

Greg

 

Does a Metatrader Hot Key Addon Exist?

Fellow Forum Members,

I am using Metatrader 4 and what is driving me crazy is that it has no built in feature that enables one to assign hot keys for toggling between charts. I have some 23 currency pairs and scrolling through all of 23 tabs at the bottom is something I dislike doing.

Is there an addon out there that will let me assign a hot keys such as "Control+ALT+1" to toggle over to the USD/GBP chart or "Control+ALT+2" to toggle over to the USD/CAD chart?

I am hoping someone out there has a solution for this because I am the type of computer user that likes to control software apps mostly by using my keyboard keys. Any info will be greatly appreciated. Thanks in advance.

 
 

please remove my post problem solved . I am Idiot had wrong globals and didn;t even notice

 

HotKeys

hi CG,

I am using this hotkey snippet in my EA and have been for some time, but I am having a problem with it. When I press a alt+p for example, it usually executes on several charts simultaneously (5 instances are running across different currency pairs)...seems very random... I have tried to figure out a way to only have the hotkey applied to the active widow with focus to no avail. If you could give me a pointer/example to fix this problem it would be much better... thanks

Stan

 

MT4 Buy Sell scirpt

Is there an EA or something that does the following:

======================================

When i Press B it buys number of set orders

When i prss S it Sells number of orders set

in the properties of EA be able to set the number of Orders, TP and SL

The orders dont have to open at same price, they can open as the market goes

Example if chart goes down and i decide now is the time to press S

it must open one order, then order 2 the order 3 ....

Orders taken would then look similar to this

Sell 1.36003 TP 1.36007 SL 1.36000

Sell 1.36008 TP 1.36011 SL 1.36005

Sell 1.36010 TP 1.36013 SL 1.36010

If i pres B it must buy 3 orders one after the other, my other EA currently only puts the TP and SL in for me but i find that pressing new order, click sell or buy then click ok ... its just frustrating by the time i made three the market turns, i need to trade faster! no time for click click click ... ( i drink too much coffee i guess @ 11 cups a day so far so i need something like this )

=====================================================

Some of you will now comment why do i want to trade like this etc etc ... if you have some other comment not related to this question keep it for yourself im realy not interested in anyones opinion on my spelling grammer my hairstyle my opinions my needs or anything other than the question that was aksed .... besides I think the smallest ant can bring down the biggest of castles with the smallest bytes ...

Reason: