Start/Stop EA!

 

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!

 
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());
}
 
Yes. Got it. Thanks for speedy support
Reason: