Run script through Expert Advisor - page 9

 

And I have my buttons!

Now, I will just do some styling.

 
onewithzachy:

Hi Dadas,

1. Try the best you can the EA smiley is not clickable.

2. Don't post de-compiled code. Compiled codes are copyrighted material belong to its owner. By de-compiling it, you are violating the owner copyright. mql4-mql5 .com belong to MetaQuotes (MQ), and MQ does not support copyright violation.

1. What do you mean?

I click the smiley face when my EA is on the chart and the EA control panel opens - always, when I click once on the "X", the FROWN or the SMILE.

2. OK, deleted it - but it comes free, and with demo as well, so what is the hassle about?

And I did not decompile it! I posted .ex4 not .mq4 ! I do not have .mq4 for OneClickTrading script.

3. & 4. Irrelevant - I have found what I need!

 
Dadas:

1. What do you mean?

I click the smiley face when my EA is on the chart and the EA control panel opens - always, when I click once on the "X", the FROWN or the SMILE.

2. OK, deleted it - but it comes free, and with demo as well, so what is the hassle about?

And I did not decompile it! I posted .ex4 not .mq4 ! I do not have .mq4 for OneClickTrading script.

3. & 4. Irrelevant - I have found what I need!

Hi Dadas,

1. You're right about number 1. The smiley is hard coded into MT. My EA works in a loop, so clicking that won't open property window.

2. It come free without the source code, and you were saying "I have been trying to find a free decompiler, but could not. Help appreciated - maybe you Guys can do smth with this file?" .

3. You already found that in ho ho and yet you keep asking so I answered.

 
onewithzachy:

Hi Dadas,

3. You already found that in ho ho and yet you keep asking so I answered.

No, I did not find it in your ho ho!

I found it here: https://www.mql5.com/go?link=https://www.fx1.net/wiki/pmwiki.php/MT4GUI/MT4GUI

- you must have missed my earlier post.

And it is working!!!

Maybe it is the same in your hoho, I do not know.

What I found is clearly explained, and that is what I needed.

Now, the EA is calling a number of different Scripts, depending on the situation.

It is opening and closing orders automatically, or manually, at choice.

It is disabling Experts button, when needed.

I will, further introduce ON/OFF buttons for the various functions.

Then, a form box to enter Lot if LotManagement is OFF.

Then, maybe, I will put 3 different EAs in one with a switch option.

In the end, I will be thinking of making this a standalone application,

but that is a long way, because I do not have the skills, yet.

P.S. I checked - your ho ho is completely different from what I found. BTW, I found it on this forum!

 

Hi Guys,

Now my EA looks like this:

And you can see it is working.

Still, not finished.

 

In case someone is looking for this information,

you can even run another EA from another EA like this:

#include <WinUser32.mqh>
#define MT4_WMCMD_REMOVE_EXPERT   33050

int start() {
if(ConditionsForOpeningMySecondEA==true) 
{

DisableExperts(); // when Experts enabled - disables Experts
RemoveEA();
DisableExperts(); // when Experts disabled - enables Experts
RunMyEA();

{
           }

void DisableExperts() // Emulates keyboard event for Ctrl+E
   {
   keybd_event(17, 0, 0, 0); // CTRL down
   keybd_event(69, 0, 0, 0); // E down
   keybd_event(69, 0, 2, 0); // E up
   keybd_event(17, 0, 2, 0); // CTRL up
   }

void RemoveEA()
   {
   PostMessageA(hwnd,WM_COMMAND,33050,1);
   }


void RunMyEA() { // Runs another EA with HOTKEY assigned
   keybd_event(18, 0, 0, 0); // ALT down
   keybd_event(69, 0, 0, 0); // E down
   keybd_event(69, 0, 2, 0); // E up
   keybd_event(18, 0, 2, 0); // ALT up
}

I use this, and it works.
 

BTW instead of

void DisableExperts() // Emulates keyboard event for Ctrl+E
   {
   keybd_event(17, 0, 0, 0); // CTRL down
   keybd_event(69, 0, 0, 0); // E down
   keybd_event(69, 0, 2, 0); // E up
   keybd_event(17, 0, 2, 0); // CTRL up
   }

use

#include <WinUser32.mqh>
#import "user32.dll"
  int GetAncestor(int hWnd, int gaFlags);
#import

void DisableExperts() // Emulates keyboard event for Ctrl+E
   {
   int hwnd = GetAncestor(WindowHandle(Symbol(),Period()),2);
   PostMessageA(hwnd,WM_COMMAND,33020,1);
   }

PS ALT + E does nothing

 
qjol:

BTW instead of

use

PS ALT + E does noting


Alt+E is not assigned to anything by default.

You must first assign it to something.

I just edited, now it is correct.

 
Yep, works great, thanks!
 

Hi Everyone,

Thanks for the contributions made here.

I am new to coding and would like to create an EA that processes scripts to place my orders, but I would like the scripts to be executed using hotkeys. I am using MT4.  Any suggestions as to how I can go about making this happen? At this stage I am not too clear on how to make the connections so this can become a reality.

Your suggestions are most welcome!


Thanks in advance :).

Reason: