MT4 se cuelga, no vuelve a llamar a start() - página 2

 

start():

int start()
  {     
   int TFInd;
   int k;  
   
   Print("start():  started . . .");  
   
   if (CheckDebug(DebugStart, 2))
      {
         DebugStr = "DebugStart: " + "begin: " + " InitialGapFound: " + BoolToString(InitialGapFound);
         PrintDebug(DebugFile, DebugStr);
      }

...

OK es sólo #define OK 0

mi archivo de registro:

2013.11.15 14:35:30 Prueba reducida 0: USDJPY M15 Debug Init() begin:
2013.11.15 14:35:30 Prueba reducida 0: USDJPY M15 DebugMyInit begin:
2013.11.15 14:35:30 Prueba reducida 0: USDJPY M15 Debug Init() return:
2013.11.15 14:35:30 Prueba reducida 0: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 0: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: comenzar: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: comenzar: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: comenzar: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: comenzar: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: comenzar: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: comenzar: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: comenzar: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: comenzar: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: comenzar: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: comenzar: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: comenzar: InitialGapFound: True
2013.11.15 14:35:30 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:31 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound
2013.11.15 14:35:32 Prueba reducida 1180990: USDJPY M15 DebugStart: begin: InitialGapFound: True
2013.11.15 14:35:32 Prueba reducida 1180990: USDJPY M15 DebugStart: InitialHistoryGapClosed
2013.11.15 14:35:32 Prueba reducida 1180990: USDJPY M15 DebugMyInit comenzar:
2013.11.15 14:35:32 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 1 nach CreateHistory()
2013.11.15 14:35:33 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 2 nach CreateHistory()
2013.11.15 14:35:34 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 3 nach CreateHistory()
2013.11.15 14:35:35 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 4 nach CreateHistory()
2013.11.15 14:35:35 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 5 nach CreateHistory()
2013.11.15 14:35:36 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 6 nach CreateHistory()
2013.11.15 14:35:37 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 7 nach CreateHistory()
2013.11.15 14:35:37 Prueba reducida 1180990: USDJPY M15 DebugMyInit retorno InitialMyInitCalls: 0 IndexCount: 8
2013.11.15 14:35:37 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound


El archivo de registro de MT4 no muestra nada. Print() no funciona en este caso cuando MT4 se cuelga, porque el archivo de registro de MT4 no se vacía. Por eso estoy usando mi propia función de registro.

ver también

WHRoeder2013.11.14 19:27#

Registrar dónde/cómo? NO puedes usar Print/Alert porque estás colgando el hilo de la GUI, la salida no se escribirá.

Archivo de registro de MT4:

13:38:00 GA_Pivot Points DE30.Z,M15: inicializado
13:38:00 $CH_Stochastic Copyright Dec2009 DE30.Z,M15: inicializado
14:35:05 GA_Daily Range Lines V1.3 _US30,M15: desinicializado
14:35:05 GA_Daily Range Lines V1.3 _US30,M15: desinicializado razón 1
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15: uninit razón 1
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15: uninit razón 1
14:35:05 GA_Pivot Points _US30,M15: deinitialized
14:35:05 GA_Pivot Points _US30,M15: uninit razón 1
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15: desinicializado
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15: uninit razón 1
14:35:05 GA_Daily Range Lines V1.3 _US30,M15: eliminado
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15: eliminado
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15: eliminado
14:35:05 GA_Pivot Points _US30,M15: eliminado
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15: eliminado
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15: uninit razón 1
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15: uninit razón 1
14:35:05 GA_Pivot Points _US30,M15: deinitialized
14:35:05 GA_Pivot Points _US30,M15: uninit razón 1
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15: desinicializado
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15: uninit razón 1
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15: eliminado
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15: eliminado
14:35:05 GA_Pivot Points _US30,M15: eliminado
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15: eliminado
14:35:05 GA_MTF MAs 1 V1.4 _EUR50,Daily: uninit razón 1
14:35:05 GA_MTF MAs 2 V1.4 _EUR50,Diario: uninit razón 1
14:35:05 GA_Pivot Points _EUR50,Daily: deinitialized
14:35:05 GA_Pivot Points _EUR50,Daily: uninit razón 1
14:35:05 $CH_Stochastic Copyright Dec2009 _EUR50,Diario: desinicializado
14:35:05 $CH_Stochastic Copyright Dec2009 _EUR50,Diario: uninit razón 1
14:35:05 GA_MTF MAs 1 V1.4 _EUR50,Daily: eliminado
14:35:05 GA_MTF MAs 2 V1.4 _EUR50,Daily: eliminado
14:35:05 GA_Pivot Points _EUR50,Diario: eliminado
14:35:05 $CH_Stochastic Copyright Dec2009 _EUR50,Diario: eliminado
14:35:05 GA_MTF MAs 1 V1.4 _DE30,M15: uninit razón 1
14:35:05 GA_MTF MAs 2 V1.4 _DE30,M15: uninit razón 1
14:35:05 GA_Puntos de giro _DE30,M15: desinicializado
14:35:05 GA_Pivot Points _DE30,M15: uninit razón 1
14:35:05 $CH_Stochastic Copyright Dec2009 _DE30,M15: desinicializado
14:35:05 $CH_Stochastic Copyright Dec2009 _DE30,M15: uninit razón 1
14:35:05 GA_MTF MAs 1 V1.4 _DE30,M15: eliminado
14:35:05 GA_MTF MAs 2 V1.4 _DE30,M15: eliminado
14:35:05 GA_Pivot Points _DE30,M15: eliminado
14:35:05 $CH_Stochastic Copyright Dec2009 _DE30,M15: eliminado
14:35:05 GA_MTF MAs 1 V1.4 DE30.Z,M15: uninit razón 1
14:35:05 GA_MTF MAs 2 V1.4 DE30.Z,M15: uninit razón 1
14:35:05 GA_Puntos de giro DE30.Z,M15: desinicializado
14:35:05 GA_Pivot Points DE30.Z,M15: uninit razón 1
14:35:05 $CH_Stochastic Copyright Dec2009 DE30.Z,M15: desinicializado
14:35:05 $CH_Stochastic Copyright Dic2009 DE30.Z,M15: uninit razón 1
14:35:05 GA_MTF MAs 1 V1.4 DE30.Z,M15: eliminado
14:35:05 GA_MTF MAs 2 V1.4 DE30.Z,M15: eliminado
14:35:05 GA_Pivot Points DE30.Z,M15: eliminado
14:35:05 $CH_Stochastic Copyright Dec2009 DE30.Z,M15: eliminado

 
mt4forum:

start():

OK es sólo #define OK 0

OK

El archivo de registro de MT4 no muestra nada. Print() no funciona en este caso cuando MT4 se cuelga, porque el archivo de registro de MT4 no se vacía. Por eso estoy usando mi propia función de registro.

ver también

WHRoeder2013.11.14 19:27#

¿Registro de dónde/cómo? NO puedes usar Print/Alert porque estás colgando el hilo de la GUI, la salida no se escribirá
Print() funcionará antes de que se cuelgue. . . si se detiene la ejecución de los EAs, y se hace clic en el botón EA, ¿no debería el archivo de registro entonces vaciarse? entonces sería capaz de ver la última impresión. . . o cambiarlo por un Comment() y borrar el comentario al final de start() con Comment(");
 

Estoy ejecutando el programa como un indicador.

Para detenerlo, tengo que matar el proceso de la terminal MT4.

He insertado comment() como has sugerido.

El comentario no aparece en el gráfico.

 
         if (TimeLocal() >= LastInitialGapCloseCheck + HistoryDownloadCheckInterval)                                  // zzz
Por qué estás llamando a TimeLocal Esa es la hora de tu máquina (en tu TZ,) no la hora de tu broker, no la hora del tester. Pruebe TimeCurrent() en ambos lugares.
 

Lo sé, lo estoy usando sólo para comprobar, cuánto tiempo ha transcurrido antes de hacer alguna comprobación de nuevo.

En este caso podría usar cualquier función de tiempo siempre que esté usando siempre la misma.

Ese no es el problema.

¿Es posible que de alguna manera esté destruyendo la pila de llamadas de la función start()?

 
mt4forum: En este caso podría utilizar cualquier función de tiempo siempre que utilice la misma. Ese no es el problema.
Es un problema si alguna vez quieres usar el probador/optimizador.
 
mt4forum:

Estoy ejecutando el programa como un indicador.

¿Está desacelerando el hilo de la interfaz?
 
RaptorUK:
¿Está desacelerando el hilo de la interfaz?

¿Qué quiere decir con eso?

 
mt4forum:

¿Qué quieres decir con eso?

En un Indicador no se puede Sleep() no se puede usar MessageBox() o si tu código simplemente tarda mucho en un bucle....

"La función no puede ser llamada desde los indicadores personalizados ya que se ejecutan dentro del hilo de la interfaz y no pueden desacelerarlo".
 

No, no uso sleep() ni messagebox(), pero hago mucho trabajo en la función MyInit(), que tarda unos 5 segundos.

Usted puede ver que en el archivo de registro:

2013.11.15 14:35:32 Prueba reducida 1180990: USDJPY M15 DebugStart: InitialHistoryGapClosed
2013.11.15 14:35:32 Prueba reducida 1180990: USDJPY M15 DebugMyInit comenzar: <---------- trabajo comienza
2013.11.15 14:35:32 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 1 nach CreateHistory()
2013.11.15 14:35:33 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 2 nach CreateHistory()
2013.11.15 14:35:34 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 3 nach CreateHistory()
2013.11.15 14:35:35 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 4 nach CreateHistory()
2013.11.15 14:35:35 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 5 nach CreateHistory()
2013.11.15 14:35:36 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 6 nach CreateHistory()
2013.11.15 14:35:37 Prueba reducida 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 7 nach CreateHistory()
2013.11.15 14:35:37 Prueba reducida 1180990: USDJPY M15 DebugMyInit retorno InitialMyInitCalls: 0 IndexCount: 8 <---------- trabajo termina
2013.11.15 14:35:37 Prueba reducida 1180990: USDJPY M15 DebugStart: último retorno en InitialGapFound

Pero, ¿por qué eso hace que MT4 entre en un bucle después de eso?

Razón de la queja: