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
No, I don't use sleep() or messagebox(), but I do a lot of work in the function MyInit(), which takes about 5 seconds.
You can see that in the log file:
2013.11.15 14:35:32 Test reduced 1180990: USDJPY M15 DebugStart: InitialHistoryGapClosed
2013.11.15 14:35:32 Test reduced 1180990: USDJPY M15 DebugMyInit begin: <---------- work starts
2013.11.15 14:35:32 Test reduced 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 1 nach CreateHistory()
2013.11.15 14:35:33 Test reduced 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 2 nach CreateHistory()
2013.11.15 14:35:34 Test reduced 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 3 nach CreateHistory()
2013.11.15 14:35:35 Test reduced 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 4 nach CreateHistory()
2013.11.15 14:35:35 Test reduced 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 5 nach CreateHistory()
2013.11.15 14:35:36 Test reduced 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 6 nach CreateHistory()
2013.11.15 14:35:37 Test reduced 1180990: USDJPY M15 DebugMyInit InitialMyInitCalls: 0 IndexCount: 7 nach CreateHistory()
2013.11.15 14:35:37 Test reduced 1180990: USDJPY M15 DebugMyInit return InitialMyInitCalls: 0 IndexCount: 8 <---------- work ends
2013.11.15 14:35:37 Test reduced 1180990: USDJPY M15 DebugStart: last return in InitialGapFound
But why would that make MT4 go in a loop after that?
You all talk about infinite loops, but no one is curious what CreateHistory() does. According to the log output it appears only in the last start() run.
I assumed it was some kind of history saving function . . . if the OP wants to show it he will . . . I assume he doesn't and even if he does it's probably not going to help us help him. The fastest way is for him to post his code so someone can look at it with a fresh pair of eyes. . . .
mt4forum2013.11.16 11:14
But why would that make MT4 go in a loop after that?
Judging by your log file it looks like it was already in a loop. What happens after it gets to 8 ? Was it in a loop if it was how do you know it exited that loop ? Did it return to init() ?
You added Print("Start Started"); and it never showed up in the log file so it never entered the start() function. That suggests it never exited the init() function. Put more Print() statements and narrow it down.
First of all, thank you for the great interest, and sorry for my late response.
I will address the different comments in the following entries.
It doesn't, but you screw up the interface thread and MT4 locks up . . . can't you do what you are doing in an EA ?
I have run the program as EA. It either hangs as well or crashes MT4.
I have run the program as EA. It either hangs as well or crashes MT4.
You all talk about infinite loops, but no one is curious what CreateHistory() does. According to the log output it appears only in the last start() run.
CreateHistory() does a lot of work. It loops through currency pairs and timeframes and generates offline charts.
But the log file shows that it finishes correctly.
Judging by your log file it looks like it was already in a loop. What happens after it gets to 8 ? Was it in a loop if it was how do you know it exited that loop ? Did it return to init() ?
You added Print("Start Started"); and it never showed up in the log file so it never entered the start() function. That suggests it never exited the init() function. Put more Print() statements and narrow it down.
After it gets to 8 it returns correctly to init().
The following line in the log file shows that. "DebugMyInit return ..." is the last debug line in MyInit().
2013.11.15 12:33:22 Test reduced 395052: USDJPY M15 DebugMyInit return InitialMyInitCalls: 0 IndexCount: 8
I use my own print function to generate the log file. Print("Start Started") does not print to that log file.
The entry
2013.11.15 12:33:22 Test reduced 395052: USDJPY M15 DebugStart: last return in InitialGapFound
shows, that it exited the init() function.
If I can trust, that my debug function logs all the information correctly, then the log file tells us, that after the last run of start(),
start() is exited and is not called again. That's the problem.