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

 
¿Pueden decirme, por favor, cómo retirar el dinero?
 
Solicitud enviada ayer, han pasado más de 24 horas y no hay noticias
 
ivlyeva.tatyana6:
Envié una solicitud ayer, ha pasado más de un día y silencio.

1. Ir al cajero automático más cercano, insertar la tarjeta, introducir el código pin...

2. Ve al banco más cercano, haz contacto visual, luego sigue la situación...

3. Ve al mercado. 3) Ir al mercado. Ve al banco. Retirar fondos (puedes retirarlos todos, no sólo los tuyos...) ...

4. ¡Si tienes que retirar dinero de MMM, entonces ni siquiera el tanque te ayudará!

Y en serio, ¡no puedes!

 
//+------------------------------------------------------------------+
//|                                                  MACD Sample.mq4 |
//|                   Copyright 2005-2014, MetaQuotes Software Corp. |
//|                                              http://www.mql4.com |
//+------------------------------------------------------------------+
#property copyright   "2005-2014, MetaQuotes Software Corp."
#property link        "http://www.mql4.com"
input double TakeProfit    =3160;
input double Lots          =0.5;
input double TrailingStop  =1040;
input int OpenLevel =22;
input int CloseLevel=77;
input int    Period =85;
input int    Period1 =57;
int LastBars=0;
extern int Magic = 110725;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick(void)
  {
   
 
   int    cnt,ticket,total;
//---
// initial data checks
// it is important to make sure that the expert works with a normal
// chart and the user did not make any mistakes setting external 
// variables (Lots, StopLoss, TakeProfit, 
// TrailingStop) in our case, we check TakeProfit
// on a chart of less than 100 bars
//---
//--- Trade only if new bar has arrived
   if(LastBars!=Bars) LastBars=Bars;
   else return(0);
   if(Bars<100)
     {
      Print("bars less than 100");
      return;
     }
   if(TakeProfit<10)
     {
      Print("TakeProfit less than 10");
      return;
     }
//--- to simplify the coding and speed up access data are put into internal variables
   
   total=OrdersTotal();
   if(total<1)
     {
      //--- no opened orders identified
      if(AccountFreeMargin()<(1000*Lots))
        {
         Print("We have no money. Free Margin = ",AccountFreeMargin());
         return;
        }
      //--- check for long position (BUY) possibility
     if(iRSI(NULL,0,OpenLevel,PRICE_LOW,Period)>iRSI(NULL,0,CloseLevel,PRICE_HIGH,Period1)) 
        {
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-TakeProfit*Point,Bid+TakeProfit*Point,"USDCADH4",Magic,0,Green);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
               Print("BUY order opened : ",OrderOpenPrice());
           }
         else
            Print("Error opening BUY order : ",GetLastError());
         return;
        }
      //--- check for short position (SELL) possibility
      if(iRSI(NULL,0,OpenLevel,PRICE_LOW,Period1)<iRSI(NULL,0,CloseLevel,PRICE_HIGH,Period)) 
        {
         ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+TakeProfit*Point,Ask-TakeProfit*Point,"USDCADH4",Magic,0,Red);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
               Print("SELL order opened : ",OrderOpenPrice());
           }
         else
            Print("Error opening SELL order : ",GetLastError());
        }
      //--- exit from the "no opened orders" block
      return;
     }
//--- it is important to enter the market correctly, but it is more important to exit it correctly...   
   for(cnt=0;cnt<total;cnt++)
     {
      if(!OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
         continue;
      if(OrderType()<=OP_SELL &&   // check for opened position 
         OrderSymbol()==Symbol())  // check for symbol
        {
         //--- long position is opened
         if(OrderType()==OP_BUY)
           {
            //--- should it be closed?
              if(iRSI(NULL,0,OpenLevel,PRICE_LOW,Period1)<iRSI(NULL,0,CloseLevel,PRICE_HIGH,Period)) 
              {
               //--- close order and exit
               if(!OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet))
                  Print("OrderClose error ",GetLastError());
               return;
              }
            //--- check for trailing stop
            if(TrailingStop>0)
              {
               if(Bid-OrderOpenPrice()>Point*TrailingStop)
                 {
                  if(OrderStopLoss()<Bid-Point*TrailingStop)
                    {
                     //--- modify order and exit
                     if(!OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green))
                        Print("OrderModify error ",GetLastError());
                     return;
                    }
                 }
              }
           }
         else // go to short position
           {
            //--- should it be closed?
           if(iRSI(NULL,0,OpenLevel,PRICE_LOW,Period)>iRSI(NULL,0,CloseLevel,PRICE_HIGH,Period1)) 
              {
               //--- close order and exit
               if(!OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet))
                  Print("OrderClose error ",GetLastError());
               return;
              }
            //--- check for trailing stop
            if(TrailingStop>0)
              {
               if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
                 {
                  if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
                    {
                     //--- modify order and exit
                     if(!OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red))
                        Print("OrderModify error ",GetLastError());
                     return;
                    }
                 }
              }
           }
        }
     }
//---
  }
//+------------------------------------------------------------------+

Hola. Por favor, ayúdenme a entender... El Asesor Experto está cerrando las operaciones de otras personas o no abriendo las suyas si hay operaciones de otras personas.

 
darirunu1:

Hola. Por favor, ayúdenme a entender... El Asesor Experto está cerrando las operaciones de otras personas o no abriendo las suyas si hay operaciones de otras personas.

¿Dónde está su mago para encontrar pedidos?
 

Si se escribe arriba, el Asesor Experto cierra las operaciones abiertas manualmente,

Si lo pongo de esta manera

 if(!OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
         continue;
      if(OrderType()<=OP_SELL &&   // check for opened position 
         OrderSymbol()==Symbol()&& OrderMagicNumber()==Magic)  // check for symbol

Si hay operaciones abiertas manualmente, el Asesor Experto no cerrará otras operaciones, pero no abrirá las suyas si hay operaciones abiertas manualmente.

 
darirunu1:

Si se escribe arriba, el Asesor Experto cierra las operaciones abiertas manualmente,

Si lo pongo de esta manera

Si hay operaciones abiertas manualmente, el Asesor Experto no cerrará otras operaciones, pero no abrirá las suyas si hay operaciones abiertas manualmente.

También es necesario seleccionar por medio de la magia al abrir
 
MakarFX:
También necesito la selección del número mágico en la apertura
 ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+TakeProfit*Point,Ask-TakeProfit*Point,"USDCADH4",Magic,0,Red);

¿Qué es esto? La apertura está indicada. La cuestión es que cuando se utilizan varios Asesores Expertos, no hay ningún problema. El problema ocurre sólo cuando hay una apertura manual de una posición en la cuenta.

En cuanto se abren operaciones en la cuenta manualmente, el Asesor Experto deja de funcionar.

En cuanto elimine esto en el código, total=OrdersTotal();

if(total<1)

Los EAs van directos, pero abren muchas operaciones

 
darirunu1:

¿Qué es esto? La apertura está indicada. El caso es que cuando se utilizan varios EAs no hay ningún problema, el problema se da sólo cuando hay una apertura manual de una posición en la cuenta.

En cuanto se abren operaciones en la cuenta manualmente, el Asesor Experto deja de funcionar.

En cuanto elimine esto en el código, total=OrdersTotal();

if(total<1)

Los EAs van directos, pero abren muchas operaciones.

Esto es lo que estoy hablando - OrdersTotal() es para todas las órdenes y necesita una orden EA

   if(CountOrders("", -1,  Magic)<1)
     {
     открытие ордеров
     }
//+----------------------------------------------------------------------------+
//| Подсчет ордеров                                                            |
//+----------------------------------------------------------------------------+
//| -1 - Все типы ордеров                                                      |
//|  0 - ордера типа BUY                                                       |
//|  1 - ордера типа SELL                                                      |
//|  2 - ордера типа BUYLIMIT                                                  |
//|  3 - ордера типа SELLLIMIT                                                 |
//|  4 - ордера типа BUYSTOP                                                   |
//|  5 - ордера типа SELLSTOP                                                  |
//+----------------------------------------------------------------------------+
int CountOrders(string symb="", int or_ty=-1, int magiс=-1) 
  {
   int cnt=0;
   if(symb=="0") symb=_Symbol;
   for(int pos=OrdersTotal()-1;pos>=0;pos--)
     {
      if(OrderSelect(pos,SELECT_BY_POS)==true)
        {
         if((OrderSymbol()==symb || symb=="")&&(or_ty<0 || or_ty==OrderType()))
           {
            if(magiс<0 || OrderMagicNumber()==magiс) cnt++;
           }
        }
     }
   return(cnt);
  }
 
MakarFX:

A eso me refiero, OrdersTotal() son todos los pedidos y tú quieres los de EA

if(CountOrders("", -1,  Magic)<1)
     {

Esto es en lugar de

total=Total de pedidos();

if(total<1) o dejamos este también?

Razón de la queja: