Any Way to Interact With an EA (with mouse or keyboard input) ?

 

Hi

Is there any way to communicate with an EA by means of mouse or keyboard strokes ?

In all programming languages it's a common thing but i did not find any particular command for this kind of interaction in MQL4.

I know that some programmers write codes to do some actions(such as close all positions or something like that) by dragging a box on the screen but I don't know how.

I would be very grateful if someone could help me to learn that.

Thanks

 

i am working at an project for monitoring and remotecontrolling EAs via a webbrowser.

possible at one PC, LAN or even worldwide via Internet

that is the easiest solution i have found.

 
meikel:

i am working at an project for monitoring and remotecontrolling EAs via a webbrowser.

possible at one PC, LAN or even worldwide via Internet

that is the easiest solution i have found.

I don't understand what you mean by controlling by a web browser ?

I have already use remote control but what i want to know is the method of interaction with EA by MQL4 commands and using mouse activities.

(I have learned working with MessageBox,Global variables, CSV files and so on,what i exactly want to know is the method of interaction with the ea using the most popular i/o device (mouse)).

if the project that you mentioned is about that,describing it will help.

Thanks anyway

 
hemmat:

I have already use remote control but what i want to know is the method of interaction with EA by MQL4 commands and using mouse activities.

See https://www.mql5.com/en/forum/115921 for one way of doing this.

 
or do you mean something like Drag and Drop SL TP
 
hemmat wrote >>

Hi

Is there any way to communicate with an EA by means of mouse or keyboard strokes ?

In all programming languages it's a common thing but i did not find any particular command for this kind of interaction in MQL4.

I know that some programmers write codes to do some actions(such as close all positions or something like that) by dragging a box on the screen but I don't know how.

I would be very grateful if someone could help me to learn that.

Thanks

Hi

1 - try MQL 5 :)

2 - You can use TextObject ( with Chart Shift activate to manage a blank space to put them) and detect ther position with Time[0]. If the Object as its Time value under Time[0], the operator has move it to trigger an action. ex :

int TouchPadPos = Time[0];

if (BoutonNewTradeAchatPos < TouchPadPos )
{
RefreshRates();
Nbre_Lot_Spécial = 0;
if (Calcul_Nb_Lot(Bid,Signal_Achat,OP_BUY,Nbre_Lot_Spécial)==false) Nbre_Lot_Spécial=0;
else Nbre_Lot_Spécial = NormalizeDouble(Nbre_Lots_Possible,1);

ret=MessageBox("Achat de "+DoubleToStr(Nbre_Lots_Possible,1)+" lot(s) "+Symbol()+" à "+DoubleToStr(Bid,Nb_Decimal), "Question", MB_YESNO|MB_ICONQUESTION);

if(ret==IDYES)
{
ObjectMove(BoutonNewTradeAchat,0,PositionMenuH,WindowPriceMax(0)-(PositionMenuV*5));
Force_Achat(7010000,"Achat Manuel");
}
ObjectMove(BoutonNewTradeAchat,0,PositionMenuH,WindowPriceMax(0)-(PositionMenuV*5));
return;
}
ObjectMove(BoutonNewTradeAchat,0,PositionMenuH,WindowPriceMax(0)-(PositionMenuV*5));

 
jjc:

See https://www.mql5.com/en/forum/115921 for one way of doing this.

It seems more than i expect,jjc.

Thanks

 
Matutin:

Hi

1 - try MQL 5 :)

2 - You can use TextObject ( with Chart Shift activate to manage a blank space to put them) and detect ther position with Time[0]. If the Object as its Time value under Time[0], the operator has move it to trigger an action. ex :

int TouchPadPos = Time[0];

if (BoutonNewTradeAchatPos < TouchPadPos )
{
RefreshRates();
Nbre_Lot_Spécial = 0;
if (Calcul_Nb_Lot(Bid,Signal_Achat,OP_BUY,Nbre_Lot_Spécial)==false) Nbre_Lot_Spécial=0;
else Nbre_Lot_Spécial = NormalizeDouble(Nbre_Lots_Possible,1);

ret=MessageBox("Achat de "+DoubleToStr(Nbre_Lots_Possible,1)+" lot(s) "+Symbol()+" à "+DoubleToStr(Bid,Nb_Decimal), "Question", MB_YESNO|MB_ICONQUESTION);

if(ret==IDYES)
{
ObjectMove(BoutonNewTradeAchat,0,PositionMenuH,WindowPriceMax(0)-(PositionMenuV*5));
Force_Achat(7010000,"Achat Manuel");
}
ObjectMove(BoutonNewTradeAchat,0,PositionMenuH,WindowPriceMax(0)-(PositionMenuV*5));
return;
}
ObjectMove(BoutonNewTradeAchat,0,PositionMenuH,WindowPriceMax(0)-(PositionMenuV*5));

Thank you Matutin.

With MT5 i would have greater problems with my strategies because of its single position system.I don't understand why it is so.

However your answer was a great help(I'm trying to test it in my codes)

Good Luck

 
WHRoeder:
or do you mean something like Drag and Drop SL TP

I will check it.

Thanks for your care.

Reason: