Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course






Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old 02-16-2009, 04:21 AM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Question 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
Attached Files
File Type: mq4 KB.mq4 (4.9 KB, 62 views)
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #12 (permalink)  
Old 02-16-2009, 07:55 AM
Junior Member
 
Join Date: Apr 2007
Posts: 7
pips4life is on a distinguished road
I need price & time (of cursor) when hotkey is pressed.

Quote:
Originally Posted by codersguru View Post
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 where was the cursor at the moment it was pressed, in terms of price and 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #13 (permalink)  
Old 02-17-2009, 05:45 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
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.


Quote:
Originally Posted by pips4life View Post
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 where was the cursor at the moment it was pressed, in terms of price and 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
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #14 (permalink)  
Old 02-17-2009, 09:59 PM
Senior Member
 
Join Date: Feb 2006
Posts: 586
Michel is on a distinguished road
Quote:
Originally Posted by codersguru View Post
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******||
PHP Code:
// Example to read the statusbar text of the explorer.exe 
procedure TForm1.Timer1Timer(SenderTObject); 
var 
  
hWindowhStatusBarHandleHWND
begin 
  hWindow 
:= FindWindow('ExploreWClass'nil); 
  if 
FensterHandle 0 then Exit; 
  
hStatusBarHandle := FindWindowEx(hWindow0'msctls_statusbar32'nil); 
  
label1.Caption := GetStatusBarText(hStatusBarHandle2); 
end

Last edited by Michel; 02-17-2009 at 10:46 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #15 (permalink)  
Old 04-20-2009, 10:08 PM
Junior Member
 
Join Date: Jan 2009
Posts: 1
tdbarnard is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #16 (permalink)  
Old 06-07-2009, 03:24 PM
Junior Member
 
Join Date: Jul 2008
Posts: 5
Hakim314 is on a distinguished road
Question 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #17 (permalink)  
Old 10-03-2009, 02:50 AM
Junior Member
 
Join Date: May 2009
Posts: 14
binar is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #18 (permalink)  
Old 10-21-2009, 06:42 AM
Junior Member
 
Join Date: Oct 2009
Posts: 2
bluemaster is on a distinguished road
Unhappy Hot key buy & sell

When you want to open a quick trade is there a better way to do that? I know about the F8 key, but you still have to do other steps to get into a trade. Is there a faster way? or does meta trader not have it?

Does it exist?

I am using Forex Trading, Broker and Software provider for FX, CFD's, Gold, Silver Futres & Options Trading - AxisODL and trade.mq4 script doesn't work on live account .

trade.mq4:
//+------------------------------------------------------------------+
//| trade.mq4 |
//| Copyright © 2004, MetaQuotes Software Corp. |
//| Forex Trading Software: Forex Trading Platform MetaTrader 4 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"

#include <stdlib.mqh>
#include <WinUser32.mqh>
//+------------------------------------------------------------------+
//| script "trading for all money" |
//+------------------------------------------------------------------+
int start()
{
//----
if(MessageBox("Do you really want to BUY 1.00 "+Symbol()+" at ASK price? ",
"Script",MB_YESNO|MB_ICONQUESTION)!=IDYES) return(1);
//----
int ticket=OrderSend(Symbol(),OP_BUY,1.0,Ask,3,0,0,"ex pert comment",255,0,CLR_NONE);
if(ticket<1)
{
int error=GetLastError();
Print("Error = ",ErrorDescription(error));
return;
}
//----
OrderPrint();
return(0);
}
//+------------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #19 (permalink)  
Old 10-21-2009, 11:39 AM
Junior Member
 
Join Date: Oct 2009
Posts: 2
bluemaster is on a distinguished road
please remove my post problem solved . I am Idiot had wrong globals and didn;t even notice
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
scalping

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send Email On Pre Set Time not Working, event is not firing ! icm63 Metatrader 4 2 03-26-2007 08:55 AM
Event driven programming cardio Setup Questions 1 03-25-2006 02:33 PM


All times are GMT. The time now is 09:34 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.