Cualquier pregunta de los recién llegados sobre MQL4 y MQL5, ayuda y discusión sobre algoritmos y códigos - página 1788

 
Nerd Trader #:

...



 
Nerd Trader #:
En la configuración del ide, ¿cómo puedo eliminar la inserción sin sentido de un rectángulo entre las funciones?

Para mí también es completamente innecesario:

class cMy_class
  {
public:
   //Тут плюсуем
   int               Plus(
      int a,b//Это a и b
   );//Возвращает результат плюсования
  };
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int cMy_class::Plus(int a,b)
  {
   return a+b;
  }
 
Nerd Trader #:
si hay un espacio, seguirá sin ver el comentario.

Así es como él ve las cosas

/*******************Expert initialization function*******************/
int OnInit()
 {
  trade.LogLevel(LOG_LEVEL_NO);
  trade.SetExpertMagicNumber(1212);
  return(INIT_SUCCEEDED);
 }/******************************************************************/

/************************Expert tick function************************/
void OnTick()
 {
  Comment("", "\n",
//"p =  ", sizeP, "\n",
//"m =  ", sizeM, "\n",
//"summPlus =  ", DoubleToString(summPlus, 2), "\n",
//"summMinus =  ", DoubleToString(summMinus, 2), "\n",
//"profitStep =  ", DoubleToString(profitStep, 2),
          "\n"
         );
 }/******************************************************************/

/*********************TradeTransaction function**********************/
void OnTradeTransaction(const MqlTradeTransaction& trans,
                        const MqlTradeRequest& request,
                        const MqlTradeResult& result)
 {
if(trans.type == TRADE_TRANSACTION_DEAL_ADD)
 {
Incluso yo puedo ver el principio de la función y el final.
 
Alexey Viktorov #:

Así es como él ve las cosas.

Incluso yo puedo ver el principio de la función y el final.

No es un problema para que nadie lo vea.
Si hay una línea en blanco antes y después del comentario:

una idea inserta



Sin embargo, esto no es realmente importante, sólo tienes que utilizar un identificador diferente.

 

¡¡¡Buenos días!!!

Ayúdame a encontrar un error en el trailing stop en el código parabólico

Este es un comando para abrir un trailing stop a lo largo de la parábola

//-------------------------------------------------------------------+  Команда на модификацию трейлинг стоп первых ордеров по параболику
   if(Update_Time != iTime(Symbol(),TimeframesIndicators,0))
      Update_Time = iTime(Symbol(),TimeframesIndicators,0);
   if(CountTrade(0) == 1 || CountTrade(1) == 1)
      ParabolicTrail();

Trailing Stop de Parabolic

//+----------------------------------------------------------------------------+
//| Трейлинг стоп одиночных ордеров по параболику                              |
//+----------------------------------------------------------------------------+
void ParabolicTrail()
  {
   double PSAR = iSAR(Symbol(),TimeframesIndicators, 0.02, 0.2,0);

   int Order_total = OrdersTotal();
   for(int i=Order_total-1; i>=0; i--)
     {
      if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
         continue; //если не получилось выделить ордер
      if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic && OrderProfit() > 0 && OrderStopLoss() != 0 && OrderType() < 2)
        {
         if(OrderType() == OP_BUY)
           {
            if(PSAR < Ask && PSAR > OrderStopLoss())
              {
               if(OrderModify(OrderTicket(), OrderOpenPrice(), PSAR, OrderTakeProfit(), 0))
                 {
                  Print("Trailing Stop: Стоп Лосс ордера на покупку #",OrderTicket()," перенесен на цену ", DoubleToString(PSAR,Digits));
                 }
              }
           }
         else
            if(OrderType() == OP_SELL)
              {
               if(PSAR > Bid && PSAR < OrderStopLoss())
                 {
                  if(OrderModify(OrderTicket(), OrderOpenPrice(), PSAR, OrderTakeProfit(), 0))
                    {
                     Print("Trailing Stop: Стоп Лосс ордера на продажу #",OrderTicket()," перенесен на цену ", DoubleToString(PSAR,Digits));
                    }
                 }
              }
        }
     }
  }

No hay errores en el registro, pero la pista no se inicia

¡¡¡Gracias!!!

 
EVGENII SHELIPOV parabólico

Este es un comando para abrir un trailing stop a lo largo de la parábola

Trailing Stop de Parabolic

No hay errores en el registro, pero la pista no se inicia

¡¡¡Gracias!!!

¿Está seguro de que no hay errores?

y bajo su condición es innecesario

if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic && OrderProfit() > 0 && OrderStopLoss() != 0 && OrderType() < 2)
 

EVGENII SHELIPOV #:

No hay errores en el libro de registro, pero la red de arrastre tampoco arranca

¡¡¡Gracias!!!

Pruébalo así.

//+----------------------------------------------------------------------------+
//| Трейлинг стоп одиночных ордеров по параболику                              |
//+----------------------------------------------------------------------------+
void ParabolicTrail()
  {
   double PSAR = iSAR(Symbol(),TimeframesIndicators, 0.02, 0.2,0);

   int Order_total = OrdersTotal();
   for(int i=Order_total-1; i>=0; i--)
     {
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
        {
         if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic && OrderProfit() > 0 && OrderStopLoss() != 0)
           {
            if(OrderType() == OP_BUY)
              {
               if(PSAR < Ask && PSAR > OrderStopLoss())
                 {
                  if(OrderModify(OrderTicket(), OrderOpenPrice(), PSAR, OrderTakeProfit(), 0))
                    {
                     Print("Trailing Stop: Стоп Лосс ордера на покупку #",OrderTicket()," перенесен на цену ", DoubleToString(PSAR,Digits));
                    }
                 }
              }
            if(OrderType() == OP_SELL)
              {
               if(PSAR > Bid && PSAR < OrderStopLoss())
                 {
                  if(OrderModify(OrderTicket(), OrderOpenPrice(), PSAR, OrderTakeProfit(), 0))
                    {
                     Print("Trailing Stop: Стоп Лосс ордера на продажу #",OrderTicket()," перенесен на цену ", DoubleToString(PSAR,Digits));
                    }
                 }
              }
           }
        }
     }
  }

En cualquier caso, debe comprobar MODE_STOPLEVEL

 
MakarFX #:
¿Está seguro de que no hay errores?

y bajo su condición es innecesario.

No, sigue sin arrancar.

 
EVGENII SHELIPOV #:

No, sigue sin arrancar

Mostrar la función de apertura de pedidos
 
EVGENII SHELIPOV #:

No, sigue sin arrancar.

En la captura de pantalla no se cumplen estas condiciones

  OrderStopLoss() != 0
Razón de la queja: