Errores, fallos, preguntas - página 818

 
sion:

¿Alguien utiliza OnTradeTransaction, para determinar si se ha realizado una orden?

En el probador de estrategias, cuando una operación y 2 órdenes son enviadas dentro de 3 ticks, TRADE_TRANSACTION_REQUEST sólo viene 1, en la última orden enviada.

¿Estás mirando los registros del probador o los del agente? ¿Puede escribir al Servicio de Atención al Cliente y proporcionar detalles?
Общайтесь с разработчиками через Сервисдеск!
Общайтесь с разработчиками через Сервисдеск!
  • www.mql5.com
Ваше сообщение сразу станет доступно нашим отделам тестирования, технической поддержки и разработчикам торговой платформы.
 
Rosh:
¿Estás mirando los registros de los probadores o los registros de los agentes? ¿Puede escribir al Servicio de Atención al Cliente y proporcionar detalles?

He mirado los registros en el agente, y allí debería imprimirse un trozo de registro demasiado grande. Sólo he esbozado un código aproximado, me da pereza ocuparme del Service Desk. Lo ejecuté en RoboForex desde 2011.10.10 donde aparece uno de tres TRADE_TRANSACTION_REQUEST, y en Metakvot dos de tres. Al parecer, depende de la frecuencia con la que aparezcan las garrapatas.

2012.08.22 09:43:15 Terminal SIGTrader 5 x64 build 687 iniciado

Archivos adjuntos:
test5.mq5  8 kb
 
sion:

He mirado los registros en el agente, y allí debería imprimirse un trozo de registro demasiado grande. Sólo he esbozado un código aproximado, me da pereza ocuparme del Service Desk. Lo ejecuté en RoboForex desde 2011.10.10 donde aparece uno de tres TRADE_TRANSACTION_REQUEST, y en Metakvot dos de tres. Aparentemente, depende de la frecuencia de las garrapatas.

2012.08.22 09:43:15 Terminal SIGTrader 5 x64 build 687 iniciado

En realidad,OnTradeTransaction no depende en absoluto de los ticks - es el manejador de eventos de la operación.

Y maneja su propio turno, la cola de eventos comerciales.

 
Urain:

Se supone que OnTradeTransaction no depende en absoluto de los ticks, es un manejador de eventos comerciales.

Y procesa su turno, una cola de eventos comerciales.

En este ejemplo, depende de los ticks para establecer órdenes, en cada tick se establece una nueva orden.

Me pregunto si la falta de TRADE_TRANSACTION_REQUEST ha sido repetida por los desarrolladores, o no podemos hacerlo sin Service Desk.

 
sion:

En este ejemplo, la velocidad de colocación de la orden depende de los ticks, una nueva orden se coloca en cada tick.

Me pregunto si la falta de TRADE_TRANSACTION_REQUEST fue repetida por los desarrolladores, o no puede hacerlo sin Service Desk.

Probablemente no se pueda prescindir de la SD, la función es nueva y es posible que haya fallos. Hay que investigarlo en detalle.

SZY Estoy preparando un artículo sobre cómo utilizar esta función, pero no me he encontrado con esa situación.

ZZZY Sólo lo he probado en servidores Alpari y MQ,

Si me das el nombre correcto del servidor, intentaré comprobarlo.

 
Urain:

Probablemente no sin un CD, la función es nueva y puede haber errores. Tengo que investigarlo en detalle.

Estoy haciendo un artículo sobre el uso de esta función, pero esta situación nunca me ha ocurrido.

ZZZY Lo he comprobado sólo en los servidores de Alpari y MQ,

No veo ninguna diferencia entre el nombre del servidor y el nombre del servidor.

RoboForex-MetaTrader 5

MetaQuotes-Demo

El EURUSD es la moneda, pero se menciona en los registros anteriores.

He adjuntado un archivo con la fecha 10.10.10. Lo he comprobado de nuevo y sólo muestra 1 última TRADE_TRANSACTION_REQUES en RoboForex.

 
sion:

RoboForex-MetaTrader 5

MetaQuotes-Demo

El EURUSD es la moneda, pero se menciona en los registros anteriores.

El archivo adjunto arriba muestra un comienzo en el 10 del mes, por lo tanto el comienzo de la prueba fue 2011.10.10. Lo comprobé una vez más, sólo 1 último TRADE_TRANSACTION_REQUES es recibido constantemente por RoboForex.

El error no se reproduce.

Tanto en MQ como en RoboForex, en tiempo real y en el probador todas las TRADE_TRANSACTION_REQUEST llegan normalmente.

El sistema es x86, no puedo comprobarlo en x64 ahora mismo.

 

Comparando los 2 registros, podemos ver que si OnTradeTransaction no ha sido procesado antes de que se coloque una nueva orden, TRADE_TRANSACTION_REQUEST es descartado.

Aquí hay 1 de 3

GM 0 Trade 03:35:28 2011.10.10 02:00:00 instant sell 1.00 EURUSD at 1.3385 (1.3385 / 1.3387 / 1.3385)
OL 0 Trades 03:35:28 2011.10.10 02:00:00 deal #2 sell 1.00 EURUSD at 1.3385 done (based on order #2)
JQ 0 Trade 03:35:28 2011.10.10 02:00:00 deal performed [#2 sell 1.00 EURUSD at 1.3385]
RJ 0 Trade 03:35:28 2011.10.10 02:00:00 order performed sell 1.00 at 1.3385 [#2 sell 1.00 EURUSD at 1.3385]       <== 1
MH 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 TRADE_ACTION_DEAL Установлен 1 ордер
HE 0 Trade 03:35:28 2011.10.10 02:00:00 buy limit 1.50 EURUSD at 1.3234 (1.3384 / 1.3386 / 1.3384)                    <== 2
MP 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 TRADE_ACTION_PENDING Установлен 2 ордер
QN 0 Trade 03:35:28 2011.10.10 02:00:00 buy limit 1.50 EURUSD at 1.3285 (1.3385 / 1.3387 / 1.3385)                    <== 3
MM 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 TRADE_ACTION_PENDING Установлен 2 ордер
HI 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ///////////////////// trans.type==6----- n=0
GE 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ****************************************************************************
GD 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ///////////////////// trans.type==2----- n=1
CF 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ****************************************************************************
MF 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ///////////////////// trans.type==3----- n=2
OS 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ****************************************************************************
OQ 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ///////////////////// trans.type==0----- n=3
KL 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ****************************************************************************
JL 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ///////////////////// trans.type==0----- n=4
GN 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ****************************************************************************
EO 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ///////////////////// trans.type==0----- n=5
CK 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ****************************************************************************
PI 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ///////////////////// trans.type==0----- n=6
OD 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ****************************************************************************
LG 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ///////////////////// trans.type==10----- n=7
OJ 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 EnumToString(type)=TRADE_TRANSACTION_REQUEST
QN 0 test5 (EURUSD,M30) 03:35:28 2011.10.10 02:00:00 ------------trans===
TRADE_TRANSACTION_REQUEST

aquí 2 de 3

CL 0 Operación 03:36:07 2011.10.10 02:00:00 instantánea vender 1,00 EURUSD a 1,33989 (1,33989 / 1,34003 / 1,33989)
NP 0 Operaciones 03:36:07 2011.10.10 02:00:00 deal #2 sell 1.00 EURUSD at 1.33989 done (based on order #2)
QR 0 Operación 03:36:07 2011.10.10 02:00:00 operación realizada [#2 vender 1,00 EURUSD a 1,33989]
DJ 0 Comercio 03:36:07 2011.10.10 02:00:00 orden realizada vender 1.00 a 1.33989 [#2 vender 1.00 EURUSD a 1.33989] <== 1
RK 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 TRADE_ACTION_DEAL 1 orden ejecutada
QE 0 Operación 03:36:07 2011.10.10 02:00:00 límite de compra 1.50 EURUSD a 1.32490 (1.33990 / 1.34004 / 1.33990) <== 2
LS 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 TRADE_ACTION_PENDING 2nd order set
GP 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ///////////////////// trans.type==6----- n=0
JM 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ****************************************************************************
DM 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ///////////////////// trans.type==2----- n=1
JH 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ****************************************************************************
FJ 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ///////////////////// trans.type==3----- n=2
JG 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ****************************************************************************
DG 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ///////////////////// trans.type==0----- n=3
JR 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ****************************************************************************
ID 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ///////////////////// trans.type==0----- n=4
JQ 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ****************************************************************************
IR 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ///////////////////// trans.type==10----- n=5
RP 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 EnumToString(type)=TRADE_TRANSACTION_REQUEST
RG 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ------------trans===
SOLICITUD_DE_TRANSACCIÓN_COMERCIAL
...
FD 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:00 ****************************************************************************
OG 0 trade 03:36:07 2011.10.10 02:00:01 buy limit 1.50 EURUSD at 1.32992 (1.33992 / 1.34006 / 1.33992) <== 3
QQ 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:01 TRADE_ACTION_PENDING 2nd order set
RQ 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:01 ///////////////////// trans.type==0----- n=6
OO 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:01 ****************************************************************************
RM 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:01 ///////////////////// trans.type==10----- n=7
CF 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:01 EnumToString(type)=TRADE_TRANSACTION_REQUEST
CJ 0 test5 (EURUSD,H1) 03:36:07 2011.10.10 02:00:01 ------------trans===
SOLICITUD_DE_TRANSACCIÓN_COMERCIAL

...

 
Urain:

El error no funciona.

Tanto en MQ como en RoboForex, en tiempo real y en el probador todos los TRADE_TRANSACTION_REQUEST llegan normalmente.

El sistema es x86, no puedo comprobarlo en x64 por el momento.

Probado en un viejo portátil, funcionó secuencialmente: establecer órdenes - respuesta - establecer órdenes - respuesta - establecer órdenes - respuesta

Creo que debería funcionar si enviamos 2 órdenes durante 1 tick.OnTradeTransaction no funcionará a tiempo entonces.

He retocado un poco el archivo.

Archivos adjuntos:
test5.mq5  8 kb
 

Buenas tardes.

He creado una unidad para contar los tiempos en las líneas de los sobres, parece que cuenta todo correctamente, pero al registro le faltan algunas entradas - por ejemplo el registro tiene count[Number] =3 y el siguiente count[Number] =5. Veo que el recuento es correcto pero en el registro falta por alguna razóncount [Number] =4. A veces el registro tiene todas las entradas. No entiendo por qué ocurre. Si ve errores en el código, ¿puede corregirlo?

Además, a veces la ejecución del probador arroja el error "OnTick critical error" pero en el siguiente inicio comienza a probar. ¿Cuál puede ser el problema?

input string            Symb0 = "EURUSD";
input  bool            Trade0 = true;
int MA_Shift0=1;
input int MA_Per0 = 11;
input double     Envelopes_Deviation0     =0.1; 
//+-----------------------------------+
input string            Symb1 = "USDCHF";
input  bool            Trade1 = true;
int MA_Shift1=1;
input int MA_Per1 = 11;
input double     Envelopes_Deviation1     =0.1; 

bool MA (int Number,
         string  Symbol_,           // имя символа
         bool    Trade,
         int     MA_Per,         // период для расчета средней линии
         int     MA_Shift,          // смещение индикатора по горизонтали   
         double  Envelopes_Deviation,          // отклонение границ от средней линии    
         double  &Bid[],
         int &env[],
         int &count[],
         bool &flagenv[],
         bool &flagenv1[]      
        )

  {
   if(!Trade)return(true);

   static int Size_=0;

   static int Handle[];
  static int Recount[],MinBars[];
  double ma[];
  double Env_Up[2];  
double Env_Dn[2];   
 double  norm_Env_Dn;
 double  norm_Env_Up;

 
     if(Number+1>Size_) 
     {
      Size_=Number+1; 

      ArrayResize(Handle,Size_);
      ArrayResize(Recount,Size_);
      ArrayResize(MinBars,Size_);

      MinBars[Number]=3*MA_Per;

      ArraySetAsSeries(Env_Dn,true);

      Handle[Number]=iEnvelopes(Symbol_,0,MA_Per,MA_Shift,MODE_SMA,PRICE_CLOSE,Envelopes_Deviation); 
         
     }

   if(Bars(Symbol_,0)<MinBars[Number])return(true);

      if(CopyBuffer(Handle[Number],LOWER_LINE,0,2,Env_Dn)<0 || CopyBuffer(Handle[Number],UPPER_LINE,0,2,Env_Up)<0)
        {
         Recount[Number]=true; 

         return(false);  
        }
      
     
  int Digits_=int(SymbolInfoInteger(Symbol_,SYMBOL_DIGITS)+1);
  norm_Env_Dn = NormalizeDouble(Env_Dn[0], Digits_);
  norm_Env_Up = NormalizeDouble(Env_Up[0], Digits_);   
     
 Bid[Number]=SymbolInfoDouble(Symbol_,SYMBOL_BID); 
    
if(Bid[Number] < norm_Env_Dn && !flagenv1[Number]) env[Number] += 1;
if(Bid[Number] > norm_Env_Up && !flagenv[Number]) env[Number] += 2;      
if(env[Number]<=2)env[Number] *= 10;

if (env[Number]==20)flagenv[Number] = true;
if (env[Number]==10)flagenv1[Number] = true;

if(env[Number]==3 || env[Number]==12 || env[Number]==21 || env[Number]>21) 
{
env[Number]=0;
flagenv[Number] = false;
flagenv1[Number] = false;
count[Number]++;

Print("+++++++++@@@@@@@@@@@@@@@@@@@@@@@@@@@ count---------= ", count[Number],"      Number= ",Number);
}
  
  return(true);
  }
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
  static double Bid[2];
  static int env[2],count[2];
  static bool flagenv[2],flagenv1[2]; 
MA(0,Symb0,Trade0,MA_Per0,MA_Shift0,Envelopes_Deviation0,Bid,env,count,flagenv,flagenv1);
MA(1,Symb1,Trade1,MA_Per1,MA_Shift1,Envelopes_Deviation1,Bid,env,count,flagenv,flagenv1);

  }
//+------------------------------------------------------------------+