Quaisquer perguntas de recém-chegados sobre MQL4 e MQL5, ajuda e discussão sobre algoritmos e códigos - página 1538

 
Você pode me dizer como retirar o dinheiro?
 
Pedido enviado ontem, mais de 24 horas se passaram e nenhuma palavra
 
ivlyeva.tatyana6:
Enviei um pedido ontem, já passou mais de um dia e o silêncio.

1. Vá ao caixa eletrônico mais próximo, insira o cartão, digite o código do pino...

2. Vá ao banco mais próximo, faça contato visual, depois siga a situação...

3. Ir para o mercado. 3) Ir para o mercado. Vá até o banco. Retirar fundos (você pode retirá-los todos, não apenas os seus próprios...) ...

4. Se você tiver que retirar dinheiro da MMM, então nem mesmo o tanque o ajudará!

E sério, você não pode!

 
//+------------------------------------------------------------------+
//|                                                  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;
                    }
                 }
              }
           }
        }
     }
//---
  }
//+------------------------------------------------------------------+

Olá. Por favor, ajude-me a entender... O Expert Advisor está fechando ou não abrindo os negócios de outras pessoas se houver negócios de outras pessoas.

 
darirunu1:

Olá. Por favor, ajude-me a entender... O Expert Advisor está fechando ou não abrindo os negócios de outras pessoas se houver negócios de outras pessoas.

Onde está o seu mágico para encontrar encomendas?
 

Se estiver escrito acima, o Expert Advisor fecha as negociações abertas manualmente,

Se eu colocar desta forma

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

Se houver alguma negociação aberta manualmente, então o Expert Advisor não fechará outras negociações, mas não abrirá suas próprias negociações se houver alguma negociação aberta manualmente.

 
darirunu1:

Se estiver escrito acima, o Expert Advisor fecha as negociações abertas manualmente,

Se eu colocar desta forma

Se houver alguma negociação aberta manualmente, então o Expert Advisor não fechará outras negociações, mas não abrirá suas próprias negociações se houver alguma negociação aberta manualmente.

também necessitam de seleção por feitiçaria ao abrir
 
MakarFX:
Eu também preciso selecionar o número mágico na abertura
 ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+TakeProfit*Point,Ask-TakeProfit*Point,"USDCADH4",Magic,0,Red);

O que é isto? A abertura é indicada. O problema é que quando você usa vários Expert Advisors, não há problema. O problema ocorre apenas quando há uma abertura manual de uma posição na conta.

Assim que há negócios abertos manualmente na conta, o Expert Advisor deixa de funcionar.

Assim que eu remover isto no código, total=OrdensTotal();

if(total<1)

EAs seguem em frente, mas abrem muitos negócios

 
darirunu1:

O que é isto? A abertura é indicada. O problema é que quando você usa vários Expert Advisors, não há problema. O problema ocorre apenas quando há uma abertura manual de uma posição na conta.

Assim que há negócios abertos manualmente na conta, o Expert Advisor deixa de funcionar.

Assim que eu remover isto no código, total=OrdensTotal();

if(total<1)

EAs seguem em frente, mas abrem muitos negócios.

É disto que eu estou falando - OrdensTotal() é para todas as ordens e você precisa de uma ordem 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:

É disso que estou falando, OrdensTotal() é tudo ordens, e você quer ordens EA

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

Isto é, em vez de

total=OrdensTotal();

se(total<1) ou deixamos este também?

Razão: