O MT4 fica pendurado, não chama o início() novamente - página 2

 

início():

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

...

OK é apenas #define OK 0

meu arquivo de log:

2013.11.15 14:35:30 Teste reduzido 0: USDJPY M15 Debug Init() começa:
2013.11.15 14:35:30 Teste reduzido 0: USDJPY M15 DebugMyInit começa: USDJPY M15 Debug Init
2013.11.15 14:35:30 Teste reduzido 0: USDJPY M15 Debug Init() retorno:
2013.11.15 14:35:30 Redução no teste 0: USDJPY M15 DebugStart: início: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 0: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:30 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:31 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound
2013.11.15 14:35:32 Teste reduzido 1180990: USDJPY M15 DebugStart: começar: InitialGapFound: Verdadeiro
2013.11.15 14:35:32 Teste reduzido 1180990: USDJPY M15 DebugStart: InitialHistoryGapCapClosed
2013.11.15 14:35:32 Teste reduzido 1180990: USDJPY M15 DebugMyInit começa:
2013.11.15 14:35:32 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 1 nach CreateHistory()
2013.11.15 14:35:33 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 2 nach CreateHistory()
2013.11.15 14:35:34 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 3 nach CreateHistory()
2013.11.15 14:35:35 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 4 nach CreateHistory()
2013.11.15 14:35:35 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 5 nach CreateHistory()
2013.11.15 14:35:36 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 6 nach CreateHistory()
2013.11.15 14:35:37 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 7 nach CreateHistory()
2013.11.15 14:35:37 Teste reduzido 1180990: USDJPY M15 DebugMyInit Retornar InicialMyInitCalls: 0 IndexCount: 8
2013.11.15 14:35:37 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound


O arquivo de registro MT4 não mostra nada. Imprimir() não funciona em tal caso quando o MT4 está pendurado, porque o arquivo de registro MT4 não é enxaguado. É por isso que eu estou usando minha própria função de log.

veja também

WHRoeder2013.11.14 19:27#

Registrando onde/como? Você NÃO pode usar a impressão/alerta porque você está pendurando o fio GUI, a saída não será escrita.

Arquivo de log MT4:

13:38:00 GA_Pivot Points DE30.Z,M15: Inicializado
13:38:00 $CH_Stochastic Copyright Dez2009 DE30.Z,M15: Inicializado
14:35:05 GA_Daily Range Lines V1.3 _US30,M15: deinicializado
14:35:05 GA_Daily Range Lines V1.3 _US30,M15: razão uninit 1
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15: razão uninit 1
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15: razão uninit 1
14:35:05 GA_Pivot Points _US30,M15: deinicializado
14:35:05 GA_Pivot Points _US30,M15: razão uninit 1
14:35:05 $CH_Stochastic Copyright Dez2009 _US30,M15: deinicializado
14:35:05 $CH_Stochastic Copyright Dez2009 _US30,M15: uninit reason 1
14:35:05 GA_Daily Range Lines V1.3 _US30,M15: removido
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15: removido
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15: removido
14:35:05 GA_Pivot Points _US30,M15: removido
14:35:05 $CH_Stochastic Copyright Dez2009 _US30,M15: removido
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15: razão uninit 1
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15: razão uninit 1
14:35:05 GA_Pivot Points _US30,M15: deinicializado
14:35:05 GA_Pivot Points _US30,M15: razão uninit 1
14:35:05 $CH_Stochastic Copyright Dez2009 _US30,M15: deinicializado
14:35:05 $CH_Stochastic Copyright Dez2009 _US30,M15: uninit reason 1
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15: removido
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15: removido
14:35:05 GA_Pivot Points _US30,M15: removido
14:35:05 $CH_Stochastic Copyright Dez2009 _US30,M15: removido
14:35:05 GA_MTF MAs 1 V1.4 _EUR50,Daily: uninit reason 1
14:35:05 GA_MTF MAs 2 V1.4 _EUR50,Daily: uninit reason 1
14:35:05 GA_Pivot Points _EUR50,Daily: deinitialized
14:35:05 GA_Pivot Points _EUR50,Daily: uninit reason 1
14:35:05 $CH_Stochastic Copyright Dez2009 _EUR50,Daily: deinitialized
14:35:05 $CH_Stochastic Copyright Dez2009 _EUR50,Daily: uninit reason 1
14:35:05 GA_MTF MAs 1 V1.4 _EUR50,Diário: removido
14:35:05 GA_MTF MAs 2 V1.4 _EUR50,Daily: removido
14:35:05 GA_Pivot Points _EUR50,Daily: removido
14:35:05 $CH_Stochastic Copyright Dez2009 _EUR50,Daily: removido
14:35:05 GA_MTF MAs 1 V1.4 _DE30,M15: razão uninit 1
14:35:05 GA_MTF MAs 2 V1.4 _DE30,M15: razão uninit 1
14:35:05 GA_Pivot Points _DE30,M15: deinicializado
14:35:05 GA_Pivot Points _DE30,M15: uninit reason 1
14:35:05 $CH_Stochastic Copyright Dez2009 _DE30,M15: deinicializado
14:35:05 $CH_Stochastic Copyright Dez2009 _DE30,M15: uninit reason 1
14:35:05 GA_MTF MAs 1 V1.4 _DE30,M15: removido
14:35:05 GA_MTF MAs 2 V1.4 _DE30,M15: removido
14:35:05 GA_Pivot Points _DE30,M15: removido
14:35:05 $CH_Stochastic Copyright Dez2009 _DE30,M15: removido
14:35:05 GA_MTF MAs 1 V1.4 DE30.Z,M15: razão uninit 1
14:35:05 GA_MTF MAs 2 V1.4 DE30.Z,M15: razão uninit 1
14:35:05 GA_Pivot Points DE30.Z,M15: deinicializado
14:35:05 GA_Pivot Points DE30.Z,M15: razão uninit 1
14:35:05 $CH_Stochastic Copyright Dez2009 DE30.Z,M15: deinicializado
14:35:05 $CH_Stochastic Copyright Dez2009 DE30.Z,M15: uninit reason 1
14:35:05 GA_MTF MAs 1 V1.4 DE30.Z,M15: removido
14:35:05 GA_MTF MAs 2 V1.4 DE30.Z,M15: removido
14:35:05 GA_Pivot Points DE30.Z,M15: removido
14:35:05 $CH_Stochastic Copyright Dez2009 DE30.Z,M15: removido

 
mt4forum:

início():

OK é apenas #define OK 0

OK

O arquivo de registro MT4 não mostra nada. Imprimir() não funciona em tal caso quando o MT4 está pendurado, porque o arquivo de log MT4 não é enxaguado. É por isso que eu estou usando minha própria função de log.

ver também

WHRoeder2013.11.14 19:27#

Registrando onde/como? Você NÃO pode usar a impressão/alerta porque você está pendurando o fio GUI, a saída não será escrita
A impressão() funcionará antes do enforcamento . . . se você parar a execução de EAs, clique no botão EA, se o arquivo de log não for nivelado ? então você poderá ver a última impressão . . . ou alterá-la para Comment() e limpar o comentário no final do início() com Comment("");
 

Estou executando o programa como um indicador.

Para pará-lo, tenho que matar o processo do terminal MT4.

Inseri comentário() como você sugeriu.

O comentário não aparece no gráfico.

 
         if (TimeLocal() >= LastInitialGapCloseCheck + HistoryDownloadCheckInterval)                                  // zzz
Por que você está ligando para a TimeLocal? Esse é seu tempo de máquina (em sua TZ), não seu tempo de corretor, não o tempo do testador. Experimente TimeCurrent() em ambos os lugares.
 

Eu sei, estou usando-o apenas para verificar, quanto tempo passou até que eu faça alguma verificação novamente.

Neste caso, eu poderia usar qualquer função de tempo, desde que eu esteja sempre usando o mesmo.

Esse não é o problema.

É possível que eu esteja de alguma forma destruindo a pilha de chamadas de função da função start()?

 
mt4forum: Neste caso eu poderia usar qualquer função de tempo, desde que eu esteja sempre usando a mesma. Esse não é o problema.
É um problema se alguma vez você quiser usar o testador/optimizador.
 
mt4forum:

Estou executando o programa como um indicador.

Você está desacelerando a linha de interface ?
 
RaptorUK:
Você está desacelerando a linha de interface?

O que você quer dizer com isso?

 
mt4forum:

O que você quer dizer com isso?

Em um Indicador você não pode dormir() você não pode usar MessageBox( ) ou se seu código leva muito tempo em um loop . .

"A função não pode ser chamada a partir de indicadores personalizados, pois eles são executados dentro de uma linha de interface e não podem desacelerá-la".
 

Não, eu não uso sono() ou messagebox(), mas faço muito trabalho na função MyInit(), que leva cerca de 5 segundos.

Você pode ver isso no arquivo de log:

2013.11.15 14:35:32 Teste reduzido 1180990: USDJPY M15 DebugStart: InitialHistoryGapCapClosed
2013.11.15 14:35:32 Teste reduzido 1180990: USDJPY M15 DebugMyInit começa: <---------- começa o trabalho
2013.11.15 14:35:32 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 1 nach CreateHistory()
2013.11.15 14:35:33 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 2 nach CreateHistory()
2013.11.15 14:35:34 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 3 nach CreateHistory()
2013.11.15 14:35:35 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 4 nach CreateHistory()
2013.11.15 14:35:35 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 5 nach CreateHistory()
2013.11.15 14:35:36 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 6 nach CreateHistory()
2013.11.15 14:35:37 Teste reduzido 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 7 nach CreateHistory()
2013.11.15 14:35:37 Teste reduzido 1180990: USDJPY M15 DebugMyInit Retornar InicialMyInitCalls: 0 IndexCount: 8 <---------- termina o trabalho
2013.11.15 14:35:37 Teste reduzido 1180990: USDJPY M15 DebugStart: último retorno em InitialGapFound

Mas por que isso faria com que o MT4 entrasse em loop depois disso?

Razão: