MT4 se bloque, n'appelle pas start() à nouveau - page 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 est juste #define OK 0

mon fichier journal :

2013.11.15 14:35:30 Test réduit 0 : USDJPY M15 Debug Init() begin :
2013.11.15 14:35:30 Test réduit 0 : USDJPY M15 DebugMyInit begin :
2013.11.15 14:35:30 Test réduit 0 : USDJPY M15 Debug Init() return :
2013.11.15 14:35:30 Test réduit 0 : USDJPY M15 DebugStart : begin : InitialGapFound : True
2013.11.15 14:35:30 Test reduced 0 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
15.11.2013 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
15.11.2013 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
15.11.2013 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
15.11.2013 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
15.11.2013 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
15.11.2013 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
15.11.2013 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
15.11.2013 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
15.11.2013 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
15.11.2013 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
15.11.2013 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:30 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:31 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound
2013.11.15 14:35:32 Test réduit 1180990 : USDJPY M15 DebugStart : début : InitialGapFound : True
2013.11.15 14:35:32 Test réduit 1180990 : USDJPY M15 DebugStart : InitialHistoryGapClosed :
2013.11.15 14:35:32 Test réduit 1180990 : USDJPY M15 DebugMyInit begin :
2013.11.15 14:35:32 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 1 nach CreateHistory()
2013.11.15 14:35:33 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 2 nach CreateHistory()
2013.11.15 14:35:34 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 3 nach CreateHistory()
2013.11.15 14:35:35 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 4 nach CreateHistory()
2013.11.15 14:35:35 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 5 nach CreateHistory()
2013.11.15 14:35:36 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 6 nach CreateHistory()
2013.11.15 14:35:37 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 7 nach CreateHistory()
2013.11.15 14:35:37 Test réduit 1180990 : USDJPY M15 DebugMyInit retour InitialMyInitCalls : 0 IndexCount : 8
2013.11.15 14:35:37 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound


Le fichier journal de MT4 ne montre rien. Print() ne fonctionne pas dans un tel cas, lorsque MT4 se bloque, car le fichier journal de MT4 n'est pas nettoyé. C'est pourquoi j'utilise ma propre fonction log.

voir aussi

WHRoeder2013.11.14 19:27#

Logging où/comment ? Vous ne pouvez PAS utiliser Print/Alert car vous suspendez le thread GUI, la sortie ne sera pas écrite.

Fichier journal MT4 :

13:38:00 GA_Pivot Points DE30.Z,M15 : initialisé
13:38:00 $CH_Stochastic Copyright Dec2009 DE30.Z,M15 : initialisé
14:35:05 GA_Daily Range Lines V1.3 _US30,M15 : désinitialisé
14:35:05 GA_Daily Range Lines V1.3 _US30,M15 : désinitialisation raison 1
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15 : raison de désinitialisation 1
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15 : raison uninit 1
14:35:05 GA_Pivot Points _US30,M15 : désinitialisé
14:35:05 GA_Pivot Points _US30,M15 : raison de désinitialisation 1
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15 : désinitialisé
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15 : uninitialisé pour raison 1
14:35:05 GA_Daily Range Lines V1.3 _US30,M15 : supprimé
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15 : supprimé
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15 : supprimé
14:35:05 GA_Pivot Points _US30,M15 : supprimé
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15 : supprimé
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15 : raison de désinit 1
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15 : raison de désinit 1
14:35:05 GA_Pivot Points _US30,M15 : désinitialisé
14:35:05 GA_Pivot Points _US30,M15 : raison de désinitialisation 1
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15 : désinitialisé
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15 : uninit reason 1
14:35:05 GA_MTF MAs 1 V1.4 _US30,M15 : supprimé
14:35:05 GA_MTF MAs 2 V1.4 _US30,M15 : supprimé
14:35:05 GA_Pivot Points _US30,M15 : supprimé
14:35:05 $CH_Stochastic Copyright Dec2009 _US30,M15 : supprimé
14:35:05 GA_MTF MAs 1 V1.4 _EUR50,Daily : raison de désinit 1
14:35:05 GA_MTF MAs 2 V1.4 _EUR50,Daily : motif de désinitialisation 1
14:35:05 GA_Pivot Points _EUR50,Daily : désinitialisé
14:35:05 GA_Pivot Points _EUR50,Daily : raison de désinitialisation 1
14:35:05 $CH_Stochastic Copyright Dec2009 _EUR50,Daily : désinitialisé
14:35:05 $CH_Stochastic Copyright Dec2009 _EUR50,Daily : uninit reason 1
14:35:05 GA_MTF MAs 1 V1.4 _EUR50,Daily : supprimé
14:35:05 GA_MTF MAs 2 V1.4 _EUR50,Daily : supprimé
14:35:05 GA_Pivot Points _EUR50,Daily : supprimé
14:35:05 $CH_Stochastic Copyright Dec2009 _EUR50,Quotidien : supprimé
14:35:05 GA_MTF MAs 1 V1.4 _DE30,M15 : raison de désinit 1
14:35:05 GA_MTF MAs 2 V1.4 _DE30,M15 : motif de désinit 1
14:35:05 GA_Pivot Points _DE30,M15 : désinitialisé
14:35:05 GA_Pivot Points _DE30,M15 : raison de désinitialisation 1
14:35:05 $CH_Stochastic Copyright Dec2009 _DE30,M15 : désinitialisé
14:35:05 $CH_Stochastic Copyright Dec2009 _DE30,M15 : uninit reason 1
14:35:05 GA_MTF MAs 1 V1.4 _DE30,M15 : supprimé
14:35:05 GA_MTF MAs 2 V1.4 _DE30,M15 : supprimé
14:35:05 GA_Pivot Points _DE30,M15 : supprimé
14:35:05 $CH_Stochastic Copyright Dec2009 _DE30,M15 : supprimé
14:35:05 GA_MTF MAs 1 V1.4 DE30.Z,M15 : raison de désinit 1
14:35:05 GA_MTF MAs 2 V1.4 DE30.Z,M15 : raison de désinit 1
14:35:05 GA_Pivot Points DE30.Z,M15 : désinitialisé
14:35:05 GA_Pivot Points DE30.Z,M15 : raison de désinitialisation 1
14:35:05 $CH_Stochastic Copyright Dec2009 DE30.Z,M15 : désinitialisé
14:35:05 $CH_Stochastic Copyright Dec2009 DE30.Z,M15 : uninit reason 1
14:35:05 GA_MTF MAs 1 V1.4 DE30.Z,M15 : supprimé
14:35:05 GA_MTF MAs 2 V1.4 DE30.Z,M15 : supprimé
14:35:05 GA_Pivot Points DE30.Z,M15 : supprimé
14:35:05 $CH_Stochastic Copyright Dec2009 DE30.Z,M15 : supprimé

 
mt4forum:

start() :

OK est juste #define OK 0

OK

Le fichier journal de MT4 ne montre rien. La fonction Print() ne fonctionne pas dans un tel cas, lorsque MT4 se bloque, car le fichier journal de MT4 n'est pas purgé. C'est pourquoi j'utilise ma propre fonction log.

voir aussi

WHRoeder2013.11.14 19:27#

Journalisation où/comment ? Vous ne pouvez PAS utiliser Print/Alert parce que vous suspendez le thread GUI, la sortie ne sera pas écrite.
Print() fonctionne avant le hang. ... si vous arrêtez les EAs en cours d'exécution, cliquez sur le bouton EA, le fichier journal ne devrait-il pas se vider ? Vous pourriez alors voir la dernière impression... ou la changer en Commentaire() et effacer le commentaire à la fin de start() avec Commentaire("") ;
 

J'exécute le programme en tant qu'indicateur.

Pour l'arrêter, je dois tuer le processus du terminal MT4.

J'ai inséré comment() comme vous l'avez suggéré.

Le commentaire n'apparaît pas sur le graphique.

 
         if (TimeLocal() >= LastInitialGapCloseCheck + HistoryDownloadCheckInterval)                                  // zzz
Pourquoi appelez-vous TimeLocal? C'est l'heure de votre machine (dans votre TZ,) pas l'heure de votre courtier, ni celle du testeur. Essayez TimeCurrent() aux deux endroits.
 

Je sais, je l'utilise juste pour vérifier combien de temps s'est écoulé avant de procéder à une nouvelle vérification.

Dans ce cas, je pourrais utiliser n'importe quelle fonction temporelle, du moment que j'utilise toujours la même.

Ce n'est pas le problème.

Est-il possible que je détruise d'une manière ou d'une autre la pile d'appels de la fonction start() ?

 
mt4forum: Dans ce cas, je pourrais utiliser n'importe quelle fonction temporelle, du moment que j'utilise toujours la même. Ce n'est pas le problème.
C'est un problème si vous voulez un jour utiliser le testeur/optimiseur.
 
mt4forum:

J'exécute le programme en tant qu'indicateur.

Décélérez-vous le fil de l'interface ?
 
RaptorUK:
Est-ce que vous ralentissez le fil de l'interface ?

Que voulez-vous dire par là ?

 
mt4forum:

Qu'est-ce que vous entendez par là ?

Dans un indicateur, vous ne pouvez pas utiliser Sleep() ou MessageBox( ), ou si votre code prend beaucoup de temps dans une boucle....

"La fonction ne peut pas être appelée depuis des indicateurs personnalisés car ils sont exécutés dans le thread de l'interface et ne peuvent pas le ralentir."
 

Non, je n'utilise pas sleep() ou messagebox(), mais je fais beaucoup de travail dans la fonction MyInit(), qui prend environ 5 secondes.

Vous pouvez le constater dans le fichier journal :

2013.11.15 14:35:32 Test réduit 1180990 : USDJPY M15 DebugStart : InitialHistoryGapClosed
2013.11.15 14:35:32 Test réduit 1180990 : USDJPY M15 DebugMyInit begin : <---------- travail commence
2013.11.15 14:35:32 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 1 nach CreateHistory()
2013.11.15 14:35:33 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 2 nach CreateHistory()
2013.11.15 14:35:34 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 3 nach CreateHistory()
2013.11.15 14:35:35 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 4 nach CreateHistory()
2013.11.15 14:35:35 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 5 nach CreateHistory()
2013.11.15 14:35:36 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 6 nach CreateHistory()
2013.11.15 14:35:37 Test réduit 1180990 : USDJPY M15 DebugMyInit InitialMyInitCalls : 0 IndexCount : 7 nach CreateHistory()
2013.11.15 14:35:37 Test réduit 1180990 : USDJPY M15 DebugMyInit retour InitialMyInitCalls : 0 IndexCount : 8 <---------- fin du travail
2013.11.15 14:35:37 Test réduit 1180990 : USDJPY M15 DebugStart : dernier retour dans InitialGapFound

Mais pourquoi cela fait-il que MT4 passe en boucle après cela ?