Hello, im new on EA´s i currently have one problem, my EA seems to not be running (not displaying any comments, and suddenly on certain symbols it starts working an not on others,
attached my on tick code and a picture of 12 symbols running my EA and only some have the comments and are operating (after almost 6 hours) .
any help is welcome
Ed
voidOnTick(){
//contar las posiciones abiertas de este par y globales
operaciones=0;
GlobalOP=0;
for (int o=PositionsTotal()-1; o>=0; o--){
string simbolo=PositionGetSymbol(o);
if (Symbol()==simbolo){
operaciones+=1;
}
GlobalOP+=1;
}
rsi=(RSI(pos));
//Comment ("RSI = ",rsi,"\n");//msg RSIif ((rsi<RSILowLimit) && (operaciones==maxOperaciones) && (rsi_low==0) && (GlobalOP<maxGlobalOp)){
Alert("No puede comprar Maximo De operaciones "+Symbol()+" alcanzado : "+maxOperaciones);
SendNotification("No puede comprar Maximo De operaciones "+Symbol()+" alcanzado : "+maxOperaciones);
Print("No puede comprar Maximo De operaciones ",Symbol()," alcanzado : ",maxOperaciones);
}
if ((rsi>RSIHighLimit) && (operaciones==maxOperaciones) && (rsi_low==0) && (GlobalOP<maxGlobalOp)){
Alert("No puede vender Maximo De operaciones "+Symbol()+" alcanzado : "+maxOperaciones);
SendNotification("No puede vender Maximo De operaciones "+Symbol()+" alcanzado : "+maxOperaciones);
Print("No puede vender Maximo De operaciones ",Symbol()," alcanzado : ",maxOperaciones);
}
if ((rsi<RSILowLimit) && (operaciones<maxOperaciones) && (rsi_low==0) && (GlobalOP==maxGlobalOp)){
Alert("No puede comprar Maximo De operaciones Globales alcanzado : "+maxOperaciones);
SendNotification("No puede comprar Maximo De operaciones Globales alcanzado : "+maxOperaciones);
Print("No puede comprar Maximo De operaciones Globales alcanzado : ",maxOperaciones);
}
if ((rsi>RSIHighLimit) && (operaciones>maxOperaciones) && (rsi_low==0) && (GlobalOP==maxGlobalOp)){
Alert("No puede vender Maximo De operaciones Globales alcanzado : "+maxGlobalOp);
SendNotification("No puede vender Maximo De operaciones Globales alcanzado : "+maxOperaciones);
Print("No puede vender Maximo De operaciones Globales alcanzado : ",maxOperaciones);
}
if ((rsi<RSILowLimit) && (operaciones<maxOperaciones) && (rsi_low==0) && (GlobalOP<maxGlobalOp) && time_passed){
operaciones+=1;
double Ask = NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK),_Digits);
trade.Buy((LoteBuy*multiplier), _Symbol, NULL,NULL,NULL,"AMS-Laser");
rsi_low=1;
time_passed = false;
EventSetTimer(PeriodSeconds(PERIOD_CURRENT)*CandlesToWait);
Print ("Condicion de Compra, Operacion #",operaciones," RSI= ",rsi," ",TimeLocal());
Comment ("Condicion de Compra, Operacion #",operaciones," RSI= ",rsi);
SendNotification ("Compra "+Symbol()+"Operacion #"+operaciones+" RSI= "+rsi);
Alert("Compra "+Symbol()+"Operacion #"+operaciones+" RSI= "+rsi);
}
if ((rsi>RSIHighLimit) && (operaciones<maxOperaciones) && (rsi_high==0) && (GlobalOP<maxGlobalOp) && time_passed){
operaciones+=1;
double Bid = NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_BID),_Digits);
trade.Sell((LoteSell*multiplier), _Symbol, NULL,NULL,NULL,"AMS-Laser");
rsi_high=1;
time_passed = false;
EventSetTimer(PeriodSeconds(PERIOD_CURRENT)*CandlesToWait);
Print ("Condicion de Venta, Operacion #",operaciones," RSI =",rsi," ",TimeLocal());
Comment ("condicion de Venta, Operacion #",operaciones," RSI= ",rsi);
SendNotification ("Venta "+Symbol()+"Operacion #"+operaciones+" RSI= "+rsi);
Alert("Venta "+Symbol()+"Operacion #"+operaciones+" RSI= "+rsi);
PlayAlertSound();
}
if(rsi>RSILowLimit){
rsi_low=0;
}
else{
if (rsi<RSIHighLimit){
rsi_high=0;
}
}
//buscar posicionesif (PositionSelect(_Symbol)==true)
{
//contar las posicionesfor(int i=PositionsTotal()-1; i>=0; i--)
{
//calcular el numero de tiketulong PositionTicket=PositionGetTicket(i);
//obtener el par en el que trabajamosstring PositionSymbol=PositionGetString(POSITION_SYMBOL);
//calcular precio de apertura de la posiciondouble PositionPriceOpen = PositionGetDouble(POSITION_PRICE_OPEN);
//calcular precio actualdouble PositionPriceCurrent = PositionGetDouble(POSITION_PRICE_CURRENT);
//calcular profitdouble PositionProfit=PositionGetDouble(POSITION_PROFIT);
// calcular swapint PositionSwap=(int)PositionGetDouble(POSITION_SWAP);
double positionLot=(POSITION_VOLUME);
//calcular profit netodouble PositionNetProfit=PositionProfit+PositionSwap;
//ver si alcanzamos las ganancias esperadasif ((PositionNetProfit>=ProfitUSD) && (PositionSymbol==Symbol())){
//cerrar posicion con ganancias if (trade.PositionClose(PositionTicket,-1)){
Print("Position #", PositionTicket, " closed at $",PositionNetProfit);
SendNotification(Symbol()+" Cierre de Posicion #"+PositionTicket+" Cerrado en $"+PositionNetProfit);
Alert(Symbol()+" Cierre de Posicion #"+PositionTicket+" Cerrado en $"+PositionNetProfit);
operaciones=(operaciones-1);
//deshabilitar martingala
multiplier=1;
PlayAlertSound();
}//if trade position close
}//if position net profitComment("Posicion : ",i,"\nTicket : ",PositionTicket,"\nEstado: ",PositionNetProfit,"\nPosiciones totales: ",PositionsTotal(),"\nPosiciones ",Symbol()," : ",operaciones,"\nrsi: ",rsi);
}//for close
}//if close
}//on tick close
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello, im new on EA´s i currently have one problem, my EA seems to not be running (not displaying any comments, and suddenly on certain symbols it starts working an not on others,
attached my on tick code and a picture of 12 symbols running my EA and only some have the comments and are operating (after almost 6 hours) .
any help is welcome
Ed