sunshineh:
Hi,
is there a possibility to let an EA open the orderwindow of my terminal?
Hi,
You can do that by using some Windows API functions. Below is the code you can use:
#import "user32.dll" int GetAncestor(int hWnd, int gaFlags); void keybd_event(int bVk,int bScan,int dwFlags,int dwExtraInfo); #import
..........
void OpenTradeWindow() { int hTerminal = 0; hTerminal = GetAncestor(WindowHandle(Symbol(), Period()), 2); if(hTerminal != 0) { keybd_event(0x78,0x45,0x0001,0); keybd_event(0x78,0x45,0x0001|0x2,0); } }
Cheers
Hi,
thank you very much, it works great!!!
Can I also give a Ordersize from 2.5lot to the window??
it's not more simple to use OrderSend() function
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
is there a possibility to let an EA open the orderwindow of my terminal?