Terminal Globals Problem - page 3

 

Hi, Deep Thought

I tried that and every time I've attempted it, MT4 has locked up. I wasn't sitting on a breakpoint when I tried to load the template, though. I'll try putting a break point at the beginning of OnStart() and see what happens. The IDE should be stopped regardless of the application type when you're sitting on a breakpoint. I just tried it - didn't work. When the debugger hits a breakpoint the terminal is frozen. Attempting to do anything locks it up. I do notice that you're using offline charts. I'm not. That may be the difference - if you're running MT4. Thanks for the advice - it was worth a shot. Now I've got a bigger problem. My debugger has stopped working. I must have done something but I'm not sure what. Ah - the life and times of a programmer. :-)

 

No problem.

But no, the offline charts have no effect on saving templates (at least with the latest builds, as there was a bug a few weeks ago, too).

Yes, the terminal freezes during debugging. The debugger hooks the main IDE thread, where all indicators usually run. It unfreezes for a while after it leaves your event method (OnStart, OnInit), and is alive until you stop it at a breakpoint again.

 
ProfessorMetal:

Hi, Deep Thought

I tried that and every time I've attempted it, MT4 has locked up. I wasn't sitting on a breakpoint when I tried to load the template, though. I'll try putting a break point at the beginning of OnStart() and see what happens. The IDE should be stopped regardless of the application type when you're sitting on a breakpoint. I just tried it - didn't work. When the debugger hits a breakpoint the terminal is frozen. Attempting to do anything locks it up. I do notice that you're using offline charts. I'm not. That may be the difference - if you're running MT4. Thanks for the advice - it was worth a shot. Now I've got a bigger problem. My debugger has stopped working. I must have done something but I'm not sure what. Ah - the life and times of a programmer. :-)

Sorry but I don't have any problem with the debugger. It uses the debug.tpl I saved and don't lock up.

So I can suggest you 2 things, either post here how to reproduce your issue, so we can try to help. Or write to ServiceDesk of Metaquotes.

 

Thanks again, DeepThought. I didn't really think that the charts had anything to do with it but thought it worth a mention, just in case. If you've looked at my profile, you'll have seen that I'm highly experienced developer. I've learned the hard way that what you think isn't a problem often turns out to be one. It's always worth asking a question even if you think it's moot. I do think I'm misunderstanding your previous post, though. If the terminal is frozen when the debugger hits a breakpoint, there's no way that you can load a template for the chart you're on. Obviously, I've misunderstood something you were trying to tell me.

angevoyageur,

I can't post anything more than I already have. There are no A, B, C steps that are causing this. It's acting like it's trying to find a debug template and failing to and thus not opening a chart. The log seems to bear this out. If I delete debug.tpl the debugger will open a chart. I still have to set the chart up up myself but that's better than having no debugging at all. This is beginning to look like it's an issue for the service desk. I don't know why I'm seeing this and you and DeepThought are not. I even went so far as to re-install MT4 and the situation persists. It could also be that there is something wrong with my code that's causing it to crash when it tries to load the template. I'm going to pursue that angle before I take it to the Service Desk. Right now, I need to crash myself and get some rest. I'm too tired to focus. Thanks again for your help.

 
Oh, I see your missing point now. The word is that template debug.tpl loads in automatically if the chart gets open from the debugger - the same happens for default.tpl with any ordinary chart, tester.tpl with a Strategy tester, offline.tpl with offline chart, and in addition to the strategy tester, <ea_name>.tpl loads preferably.
 

To be honest, I've never used debugger. Just use Print functions. That way, I can debug more faster. Of course use demo account but it is becoming forward testing rather than back testing.

Many people likes back testing but I likes forward testing. Whats the point you do optimization to history data ?

I do optimization on real live data. Due to that, my EA have becomes 100% stable and can handle most errors without me doing anything.

Of course it took me many months to do that but it was worth it.

 
ProfessorMetal:

Thanks again, DeepThought. I didn't really think that the charts had anything to do with it but thought it worth a mention, just in case. If you've looked at my profile, you'll have seen that I'm highly experienced developer. I've learned the hard way that what you think isn't a problem often turns out to be one. It's always worth asking a question even if you think it's moot. I do think I'm misunderstanding your previous post, though. If the terminal is frozen when the debugger hits a breakpoint, there's no way that you can load a template for the chart you're on. Obviously, I've misunderstood something you were trying to tell me.

angevoyageur,

I can't post anything more than I already have. There are no A, B, C steps that are causing this. It's acting like it's trying to find a debug template and failing to and thus not opening a chart. The log seems to bear this out. If I delete debug.tpl the debugger will open a chart. I still have to set the chart up up myself but that's better than having no debugging at all. This is beginning to look like it's an issue for the service desk. I don't know why I'm seeing this and you and DeepThought are not. I even went so far as to re-install MT4 and the situation persists. It could also be that there is something wrong with my code that's causing it to crash when it tries to load the template. I'm going to pursue that angle before I take it to the Service Desk. Right now, I need to crash myself and get some rest. I'm too tired to focus. Thanks again for your help.

Can you try with a very simple template ? Maybe it's related to the template itself ? If it's working with simple template (for example display candlestick), then go step by step by adding 1 thing at a time in your template.

If it's not working from the start, it's definitively something for the ServiceDesk.

 

DeepThought,

"The word is that template debug.tpl loads in automatically if the chart gets open from the debugger" One issue may be something that I mentioned earlier. The MT4 installation doesn't have the profiles/templates directory that the documentation says it should. That's why I added it myself and then saved my debug template to it. I've tried firing up the debugger both with MT4 running and also with it shut down and letting the debugger start everything with the same results. I've seen a couple of strange things with both approaches. The log will sometimes report an unitialization error 2, indicating that that my indie is recompiling when I start the debugger. That makes no sense. I've tried starting the debugger both with MT4 running and simply letting the debugger itself start everything with the same results. This only happens if I have the profiles/template folder in place with debug.tpl in it. If I get rid of that, the debugger brings up a chart that has the indie I'm trying to test and nothing else. As far as having the the debugger up and running and then trying to load a template goes, the debugger instantly shuts down when I select the template and I'm looking at the chart as though I started MT4 with a profile containing the chart with my setup.

deysmacro, I agree.

Back testing is useless. Like you, I forward test only. It takes a lot of time but you get a much more accurate picture of what your application is going to do. If I'm going to create a tool for my personal use or for sale commercially, I'm going to judge its efficiency by applying it to what the market is doing NOW, not what it did five years ago. To me, that's the only thing that makes sense.

Good suggestion, angevoyageur. I should have thought of that myself. I'm still not entirely certain that the indie I'm working on is blameless in this. I calculate entry and exit points based on MA's and do occasionally get zero divides. The logs suggest that's not the problem, but who knows. One reason that I don't think that's the problem is that when I have the directory and file structure set up according to the documentation is that the log shows that the indies and EA are loaded successfully and then immediately de-initialized without giving a reason as to why. I have Alerts in the OnInit()and OnDeinit() functions and none of them are executed which suggests that whatever is blowing up is doing so before anything even has a chance to execute. I'll keep plugging on this and post on what I find. It may be that I'll have to turn this over to the ServiceDesk. Like I said earlier, though, I do have a workaround, painful though it may be. :-)

 
ProfessorMetal:

DeepThought,

The MT4 installation doesn't have the profiles/templates directory that the documentation says it should. That's why I added it myself and then saved my debug template to it.


Neither mine has it in the installation directory. Never mind.
 
DeepThought:

Neither mine has it in the installation directory. Never mind.

:-)
Reason: