You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
If the terminal crashes it can be found in the event viewer (EVENTVWR) error Terminal.exe APPLICATION_HANG but if the terminal re initializes due to the watchdog timer overflow then there will not be an error in the operating system logs.
Earlier in some of the older terminal builds if your EA was going bad it would freeze and reinitialize and again load the EA that caused the problem causing an infinite loop of freezes, and it was hard to recover from this but it has been changed so that it does not happen anymore.
A simple debug print at every step along the way should identify the problem.It is not "occurring at that special moment" Your code is broken: it is an infinite loop, no matter when you call it. You don't want to answer my question and learn why!
No, if the terminal is stopping, then start will not be called.
You must find your infinite loop and fix it. If any of your loops/sleeps/web requests take any longer then 3 seconds your code will be terminated.
Absolutely does what ? Please explain how the above code could be an infinite loop.
I already answered the question 2 and 3, it's -1, which is below 0, so the loop will exit.
You're too quick. I was still editing, and realized you were correct and deleted the post. The problem must be elsewhere.
Sorry whroeder1. I did in fact answered your questions but the message was not sent. When I realized that I rewrote it quickly before going and forgot that part. Sorry.
I was saying that of course I've read the instructions manual, even before having the idea to create this thread.
Sorry whroeder1. I did in fact answered your questions but the message was not sent. When I realized that I rewrote it quickly before going and forgot that part. Sorry.
I was saying that of course I've read the instructions manual, even before having the idea to create this thread.
It would be nice to have an answer Jacques :
Forum on trading, automated trading systems and testing trading strategies
Trapping an Abnormal termination/timeout message
Alain Verleyen, 2016.12.08 15:35
It's difficult to answer without knowing the context where this code is used. In which event handler ? Is it nested deeply in other functions call ?
At first I can't see a reason. Can you provide a test code which we could use to reproduce the issue ?
It would be nice to have an answer Jacques :
Hi Alain,
The code is used in a function called within the Start() function.
The program is stopping in between the two WriteTraceFile, I have the first Write in the file but not the second. This only when I stop the program buy shutting down the platform (should be the same when switching to another time frame) , and not always.
It's a bit senseless to provide a piece of code as it's part of a complex program and not just a few lines of code.
I am proceeding step by step to localize where this Timeout is coming from (on which instruction).
Here is the code: The code causing the error for now is in comments just to be sure it's coming from those lines and I've added the test on the hard coded pairs instead. This code has ran Friday on one account and from the market opening on 2 other accounts ( I usually have many errors occurring per day). Until now there was no Timeout. I am waiting 1 or 2 days of trading and I will let you know if the Timeout has disappeared for good...
(Also those lines suspected to create the error have been recently added and the instructions ChartFirst, ChartNext never used before. It makes sense to consider those lines to be in cause but, as I've recently made a few other changes in the program, lets be sure and see how it goes)
// checking if the chart is open (not foreign trading with no instance running on the instrument) (needed in WritePositionFile( ))
chartOpen = false;
long currChart = ChartFirst();
WriteTraceFile("--- LoadOrdersTables checking if the chart is open");
//i = 1; // added because this While search was a never ending loop causing timeout >> IT IS THE SAME WITH THAT i !!!
//while(currChart>0 && i < 15)
// {if (ChartSymbol(currChart) == OOrderSymbol[curOrder]) // see here
// {chartOpen = true;
// break;
// }
// currChart=ChartNext(currChart);
// i++;
// }
if ( OOrderSymbol[curOrder] == "EURUSD"
|| OOrderSymbol[curOrder] == "GBPUSD"
|| OOrderSymbol[curOrder] == "USDCHF"
|| OOrderSymbol[curOrder] == "AUDUSD"
|| OOrderSymbol[curOrder] == "USDJPY"
|| OOrderSymbol[curOrder] == "GBPJPY"
|| OOrderSymbol[curOrder] == "USDCAD"
)
{ chartOpen = true;
}
WriteTraceFile("--- LoadOrdersTables checking if the chart is open End i="+i);