Download MetaTrader 5

Start/Stop EA!

To add comments, please log in or register
Sherif Hasan
7378
Sherif Hasan  

Hi,

I have written EA and using for more than 5 different currency pairs.

I open chart and applied my EA for different chart and different currency.

currently i remove EA when i dont want to run EA for particulr currency.

Is this possible to add code to start/stop EA as input parameters.if i need to stop EA just i choose stop from input.

please advise me your suggetions,ideas!

Ubzen
5394
Ubzen  
sheriffonline:

Hi,

I have written EA and using for more than 5 different currency pairs.

I open chart and applied my EA for different chart and different currency.

currently i remove EA when i dont want to run EA for particulr currency.

Is this possible to add code to start/stop EA as input parameters.if i need to stop EA just i choose stop from input.

please advise me your suggetions,ideas!


extern bool userStop=true;

void start(){
    if(userStop==true)return; //true means off
    double  BrkMinLot=MarketInfo(Symbol(),MODE_MINLOT);
    int Ticket=OrderSend(Symbol(),OP_BUY,BrkMinLot,Ask,0,0,0,"",0,0,0);
    if(Ticket<0) Print("Error Processing Order=",GetLastError());
}
Sherif Hasan
7378
Sherif Hasan  
Yes. Got it. Thanks for speedy support
To add comments, please log in or register