Cualquier pregunta de novato, para no saturar el foro. Profesionales, no pasen de largo. En ninguna parte sin ti - 6. - página 292

 

Chicos, por favor, aconsejar un buen DC para el comercio de EA?

 
¿Qué tipo de Asesor Experto le gustaría ejecutar en una cuenta real?
 
Profitov:
¿Qué tipo de Asesor Experto puedo preguntar? ¿Qué me dice el "Martín" sobre el próximo que le gustaría usar en una cuenta real?

No sé qué tipo de "Martín")) No, todavía no para la cuenta real, no para la demo, pero quiero usar la cuenta demo de la misma empresa de corretaje que puede ser usada para la cuenta real más adelante.

 
SpikeOne:

Chicos, ¿alguien puede describir lo que está pasando y mostrar el lugar donde las órdenes se cierran en el +, y la apertura de una nueva serie.

Andrei, no te ofendas, pero este absurdo pertenece a los Anales.
 

¡Saludos a todos! Pido ayuda para resolver un problema interesante. Tengo un EA, cuya característica es que después de obtener un beneficio las siguientes operaciones del 1 al 4 se cierran con stop loss, y luego con beneficio de nuevo. El Asesor Experto abre operaciones basadas en la señal del indicador. Para excluir las operaciones rentables que siguen después de la ganancia, uno debe omitir las señales generadas por el indicador, es decir, no cerrar las operaciones (1,2,3,4) después de obtener una ganancia. Para ello se dispone de la función Sig. Sin embargo, creo que escribí mal esta función porque el EA no abre órdenes con ella y funciona muy bien sin ella. Por favor, aconsejen a los inteligentes dónde me he equivocado.

Sí, la señal es el número de señales después del beneficio y pynkt es el tamaño del beneficio en pips.

Le agradecería la ayuda.

 
void CheckForOpen()
{
   int ticket, STOPLEVEL;
   double Price, SL, TP; 
   STOPLEVEL=MarketInfo(Symbol(),MODE_STOPLEVEL);


   double MA1Low = NormalizeDouble (iMA(NULL,0,MA_Period_2,MA_Shift_2,MA_Method_2,0,1), Digits); 
   double MA2High = NormalizeDouble (iMA(NULL,0,MA_Period_2,MA_Shift_2,MA_Method_2,1,1), Digits);
   
 
  
   if(Volume[0]>1) return;

    // продажа
   if (Open[1]>Close[1] && Open[1] > MA1Low && Close[1] < MA1Low)
   
{
      if(Pro(1,100))

   {
       ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,SL,TP,"Pattern_1",1000,0,Red);
      return;
    }
   
  }  
//---- buy conditions
   // покупка
  if (Open[1]<Close[1] && Open[1] < MA2High && Close[1] > MA2High)
 
 { 
   if(Pro(1,100))
   {
      ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,SL,TP,"Pattern_1",1000,0,Blue);
      return;
   }       
   }
}
 
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool Sig(int signal,int pynkt)
 {
  static int cnt = 0;
  static datetime tm;
  if(Time[0] == tm) return(false);
  tm = Time[0];
  if(OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY) == true)
   {
    cnt = cnt + 1;
    if(OrderType() == OP_BUY && OrderClosePrice() - OrderOpenPrice() < pynkt*Point) cnt = 0;
    if(OrderType() == OP_SELL && OrderOpenPrice() - OrderClosePrice() < pynkt*Point) cnt = 0;
    if(cnt >= signal) return(true);
   }
  return(false);
 }
//+------------------------------------------------------------------+
 
Ayúdame, el EA no compila
//ПАРАМЕТРЫ ОТКРЫТИЯ ДЛИННОЙ ПОЗИЦИИ

if(iCCI(Symbol,0,14,PRICE_TYPICAL,0)>100&&iCCI(Symbol,0,14,PRICE_TYPICAL,0)>-100 
{
if((NumberOfBarOpenLastPos()>0||NumberOfBarOpenLastPos()==-1)&&(NumberOfBarCloseLastPos()>0||NumberOfBarCloseLastPos()==-1))
{ 
Opn_B=true;
//Cls_S=true;
}
}
 //ПАРАМЕТРЫ ОТКРЫТИЯ короткой ПОЗИЦИИ    
if(iCCI(Symbol,0,14,PRICE_TYPICAL,0)<100&&iCCI(Symbol,0,14,PRICE_TYPICAL,0)<-100
{
if((NumberOfBarOpenLastPos()>0||NumberOfBarOpenLastPos()==-1)&&(NumberOfBarCloseLastPos()>0||NumberOfBarCloseLastPos()==-1))
{
Opn_S=true; 
//Cls_B=true;   
}  
}


if(Tip==0){
           if(TrailingStop>0)  
              {                 
               if(Bid-OrderOpenPrice()>Point*TrailingStop)
                 {
                  if(SL<Bid-Point*TrailingStop)
                    {
                     OrderModify(Ticket,OrderOpenPrice(),Bid-Point*TrailingStop,TP,0,Green);
                     //return(0);
                    }
                 }
              }
}

if(Tip==1){
           if(TrailingStop>0)  
              {                 
               if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
                 {
                  if(SL>Ask+Point*TrailingStop)
                    {
                     OrderModify(Ticket,OrderOpenPrice(),Ask+Point*TrailingStop,TP,0,Red);
                    // return(0);
                    }
                 }
              }
}


   // Закрытие ордеров
   while(true)                                  // Цикл закрытия орд.
     {
//длинной
//if (iRSI(NULL,0,14,PRICE_CLOSE,0)<30&&iRSI(NULL,0,14,PRICE_CLOSE,1)>30){
 if(iCCI(Symbol,0,14,PRICE_TYPICAL,0)<100&&iCCI(Symbol,0,14,PRICE_TYPICAL,0)<-100 {  
      if (Tip==0)                // Открыт ордер Buy..
        {                                       //и есть критерий закр
         Alert("Попытка закрыть Buy ",Ticket,". Ожидание ответа..");
         RefreshRates();                        // Обновление данных
         Ans=OrderClose(Ticket,Lot,Bid,2);      // Закрытие Buy
         if (Ans==true)                         // Получилось :)
           {
            Alert ("Закрыт ордер Buy ",Ticket);
            break;                              // Выход из цикла закр
           }
                           
            
         if (Fun_Error(GetLastError())==1)      // Обработка ошибок
            continue;                           // Повторная попытка
         return;                                // Выход из start()
        }
        }

// короткой       
if (Close[NULL]){
      if (Tip==1)                // Открыт ордер Sell..
        {                                       // и есть критерий закр
         Alert("Попытка закрыть Sell ",Ticket,". Ожидание ответа..");
         RefreshRates();                        // Обновление данных
         Ans=OrderClose(Ticket,Lot,Ask,2);      // Закрытие Sell
         if (Ans==true)                         // Получилось :)
           {
            Alert ("Закрыт ордер Sell ",Ticket);
            break;                              // Выход из цикла закр
           }
                  
           
         if (Fun_Error(GetLastError())==1)      // Обработка ошибок
            continue;                           // Повторная попытка
         return;                                // Выход из start()
        }
        }
      break;                                    // Выход из while
     }

 
niformalka:
ayúdame, el EA no compila.

... ¿y según qué reglas lingüísticas lo has esculpido? Por ejemplo:

if(iCCI(Symbol,0,14,PRICE_TYPICAL,0)>100&&iCCI(Symbol,0,14,PRICE_TYPICAL,0)>-100 
{

:)

 
niformalka:
ayúdame, el EA no compila

Haga doble clic en el círculo rojo que indica un error de compilación y verá el mismo círculo a la izquierda en la línea donde debe buscar el error. ¡No puedes ver tu círculo desde aquí!

¡Y borra tu post como yo borré el mío con tu hoja!

 
SpikeOne:

tienes el año 2014
Me encantaría una respuesta exhaustiva! Va a hacer que esta marca sea una de las más vendidas.
 
niformalka:

Chicos, ayudadme a encontrar un fallo, el EA no compila, ya me he devanado los sesos, presumiblemente un error en las líneas de apertura y cierre de posiciones largas/cortas


//PARÁMETRO DE POSICIÓN LARGA ABIERTA

if(iCCI(Símbolo,0,14,PRECIO_TIPICO,0)>100&&iCCI(Símbolo,0,14,PRECIO_TIPICO,0)>-100
{
if((NumberOfBarOpenLastPos()>0||NumberOfBarOpenLastPos()==-1)&&(NumberOfBarCloseLastPos()>0||NumberOfBarCloseLastPos()==-1)
{
Opn_B=true;
//Cls_S=true;
}
}
/Parámetros de apertura de puestos cortos
if(iCCI(Símbolo,0,14,PRECIO_TIPICO,0)<100&iCCI(Símbolo,0,14,PRECIO_TIPICO,0)<-100
{
if((NumberOfBarOpenLastPos()>0||NumberOfBarOpenLastPos()==-1)&&(NumberOfBarCloseLastPos()>0||NumberOfBarCloseLastPos()==-1)
{
Opn_S=true;
//Cls_B=true;
}
}


if(Tip==0){
if(TrailingStop>0)
{
if(Bid-OrderOpenPrice()>Point*TrailingStop)
{
if(SL<Punto de oferta*Punto final)
{
OrderModify(Ticket,OrderOpenPrice(),Bid-Point*TrailingStop,TP,0,Green);
//retorno(0);
}
}
}
}

if(Tip==1){
if(TrailingStop>0)
{
if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
{
if(SL>Ask+Punto*TrailingStop)
{
OrderModify(Ticket,OrderOpenPrice(),Ask+Point*TrailingStop,TP,0,Red);
// { return(0);
}
}
}
}


// Cerrar órdenes
while(true) // Cerrar el bucle de pedido
{
//largo
//if(iRSI(NULL,0,14,PRICE_CLOSE,0)<30&iRSI(NULL,0,14,PRICE_CLOSE,1)>30){
if(iCCI(Symbol,0,14,PRICE_TYPICAL,0)<100&iCCI(Symbol,0,14,PRICE_TYPICAL,0)<-100 {
if (Tip==0) //Abrir orden de compra
{ //y hay un criterio de proximidad
Alert("Intentando cerrar Buy ",Ticket,". esperando respuesta...);
RefreshRates(); // Actualizar datos
Ans=OrderClose(Ticket,Lot,Bid,2); // Cerrar la compra
if (Ans==true) // Ha funcionado :)
{
Alerta ("Orden de compra cerrada ",Ticket;)
break; // Salir del bucle de cierre
}


if (Fun_Error(GetLastError())==1) // Gestión de errores
continuar; // reintentar
return; // Salir de start()
}
}

// corto
if (Close[NULL]){
if (Tip==1) //Abrir orden de venta.
{ // hay un criterio de proximidad
Alert("Intentando cerrar la venta ",Ticket,";)
RefreshRates(); // Actualizar datos
Ans=OrderClose(Ticket,Lot,Ask,2); // Cerrar Vender
if (Ans==true) // Ha funcionado :)
{
Alerta ("Orden de venta cerrada ",Ticket;)
break; // Salir del bucle de cierre
}


if (Fun_Error(GetLastError())==1) // Gestión de errores
continuar; // reintentar
return; // Salir de start()
}
}
break; // Salir mientras
}



Lo único que el compilador no puede hacer es declarar variables.
Razón de la queja: