[¡AVISO CERRADO!] Cualquier pregunta de novato, para no saturar el foro. Profesionales, no pasen. No puedo ir a ningún sitio sin ti. - página 921

 
Nilog:
Lo intenté así. De todos modos, sólo sale una señal. :((((((((((

if (Balance < Loss)
{
switch(Delta) {

caso 1: PlaySound("LossLimitReached.wav"); Sleep (1000); break;

caso 2: PlaySound("LossLimitReached.wav"); Sleep (1000); break;

caso 3: PlaySound("LossLimitReached.wav"); Sleep (1000); break;

caso 4: PlaySound("LossLimitReached.wav"); Sleep (1000); break;

caso 5: PlaySound("LossLimitReached.wav"); Sleep (1000); break;

}

} Tal vez entonces, no tengo ninguna otra opción con seguridad,).

 
gheka:

si (Saldo < Pérdida)
{
switch(Delta)

No.

Vale, me hice un pavo a medida hace dos años que sonaba el número correcto de veces, se podía establecer cuántas. Voy a revisar el correo, a ver si lo encuentro.

 
gheka:
Necron:
significa que ya hay posiciones abiertas en la cuenta
Todavía no he tocado mi cuenta,

Abrí una nueva cuenta de demostración, nunca toqué el depósito.

NormalizeDouble(), comprueba el límite máximo/mínimo del lote, si son cinco dígitos - aumenta el stop y el beneficio en 10 veces.
 

¡¡Hola!!

¿Puede alguien sugerir un indicador que muestre el tiempo restante de una vela o barra?

No he podido encontrarlo en la base de código .....

 
igrok2008:

¡¡Hola!!

¿Puede alguien sugerir un indicador que muestre el tiempo restante de una vela o barra?

No he podido encontrarlo en la base de código .....

Hay muchos diferentes.

https://www.forex-tsd.com/indicators-metatrader-4/9487-candle-time.html

Aquí hay una.

Archivos adjuntos:
 

Una pregunta más.

El Asesor Experto compara una vela (cerrada) negra o blanca.... Negro cuando está abierto>blanco cuando está cerrado... El gráfico es de 60 minutos. Quiero comparar y cerrar velas en un gráfico de 30 minutos.

Por favor, avisa de quién puede hacer qué. Este es el código

//+------------------------------------------------------------------+
//|                                                   e_po_baram.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

//---- input parameters
extern double    Lots=0.01;
extern int       StopLoss=1500;
extern int       TakeProfit=100;
extern int       MagicNumber=123456;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
  
bool CheckOrders(int Type)
{
 bool Result=True;
 for(int i=0;i<OrdersTotal();i++)
  if(OrderSelect(i,SELECT_BY_POS))
   if(OrderMagicNumber()==MagicNumber && OrderSymbol() == Symbol())
      if(OrderType()==Type)
        {
         if(Type==OP_BUY)
           if(!OrderClose(OrderTicket(),OrderLots(),Bid,0))
             Result=False;
         if(Type==OP_SELL)
           if(!OrderClose(OrderTicket(),OrderLots(),Ask,0))
             Result=False;
         } 
        else Result=False;
 return(Result); 
}
  
  
  
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
    // Узнаем уровень стопов и спрэд
    int Spread = MarketInfo(Symbol(), MODE_SPREAD);
    int StopLevel = MarketInfo(Symbol(), MODE_STOPLEVEL);

        
   //-------------открытие позиции Buy покупка----------------- 
    if(
    (Open[i]>Close[i])&& //проверка свечи белая или чёрная для 60 мин
    () //проверка свечи белая или чёрная для 30 мин
    ) //торговое условие на покупку
     if(CheckOrders(OP_SELL))
      {
       if(StopLoss <= StopLevel+Spread)
         double SL = 0;
        else
         SL = Ask - StopLoss*Point;
       if(TakeProfit <= StopLevel-Spread)
         double TP = 0;
        else
         TP = Ask + TakeProfit*Point;
       if(!OrderSend(Symbol(), OP_BUY, Lots, Ask, 10, SL, TP, NULL, MagicNumber))
         Print("Не открыт ордер Buy. Ошибка №", GetLastError()); 
       }
    //-------------------Конец блока покупки -------------------
    
    //-------------Открытие позиции Sell продажа----------------  
    if(
    (Open[i]<Close[i])&& //проверка свечи белая или чёрная для 60 мин
    () //проверка свечи белая или чёрная для 30 мин
    )//торговое условие на продажу
     if(CheckOrders(OP_BUY))
      {
       if(StopLoss <= StopLevel+Spread)
         SL = 0;
        else
         SL = Bid + StopLoss*Point;
       if(TakeProfit <= StopLevel-Spread)
         TP = 0;
        else
         TP = Bid - TakeProfit*Point;
       if(!OrderSend(Symbol(), OP_SELL, Lots, Bid, 10, SL, TP, NULL, MagicNumber))
         Print("Не открыт ордер Sell. Ошибка №", GetLastError()); 
       }

//-----------------конец блока продажи ----------------------
   return(0);
  }
//+------------------------------------------------------------------+
 
Nilog:

Hay muchos diferentes

https://www.forex-tsd.com/indicators-metatrader-4/9487-candle-time.html

Gracias
 
¿Cómo puedo saber si hay pedidos abiertos?
 
Necron:
Haga la normalización (NormalizeDouble()), compruebe el límite máximo/mínimo del lote, si son cinco dígitos - aumente el stop y el beneficio en 10 veces.

double NormalizeDouble( valor doble, dígitos int)

valor - Valor en coma flotante. --- ¿Qué es?
dígitos - Formato de precisión, el número de dígitos después del punto decimal (0-8). --- como 1,29800 son 5 dígitos, ¿no?

 
¿Cómo puedo identificar el tipo de pedido que está abierto?
Razón de la queja: