Download MetaTrader 5
To add comments, please log in or register
One billion tasks have already been executed with MQL5 Cloud Network. Test trading robots even faster!
Carl Schreiber
5954
Carl Schreiber 2014.02.27 22:22 

Hi,

I just realized that my b509-EA with int start(){ ..} is not able to be run in the debugger X(

So I tried to use all that new void OnWhateEver().

1) From what I see in the reference I do not know whether all these functions do have/need a body or not like AccountName(). I assume not because it is written

void OnTick();

2) The old start()-function gives back an integer so it can be used to call a final function like return( myFinalFunction() ); This makes some things a lot easier!! X(

3) It really would help to have a some examples that show how to use these new functions and what kind of concept is behind their definition. :(

Gooly


PS Now I replaced start() by OnTick() but still the debugger-buttons don't work. What do I have to do to make them work for my EA?

whroeder1
13627
whroeder1 2014.02.27 22:54  
gooly: 3) It really would help to have a some examples that show how to use these new functions and what kind of concept is behind their definition. :(
int start(){
   Print("I got a tick");
   return(0); // Optional, value is never used;
}
void OnTick(){
   Print("I got a tick");
}
How much more of an example to you need?
Alain Verleyen
Moderator
28626
Alain Verleyen 2014.02.28 12:10  
gooly:

Hi,

I just realized that my b509-EA with int start(){ ..} is not able to be run in the debugger X(

So I tried to use all that new void OnWhateEver().

1) From what I see in the reference I do not know whether all these functions do have/need a body or not like AccountName(). I assume not because it is written

2) The old start()-function gives back an integer so it can be used to call a final function like return( myFinalFunction() ); This makes some things a lot easier!! X(

3) It really would help to have a some examples that show how to use these new functions and what kind of concept is behind their definition. :(

Gooly


PS Now I replaced start() by OnTick() but still the debugger-buttons don't work. What do I have to do to make them work for my EA?

In which folder is placed your EA ? Which build are you using ?
Carl Schreiber
5954
Carl Schreiber 2014.02.28 14:57  
angevoyageur:
In which folder is placed your EA ? Which build are you using ?


It was a problem of a folder. I loaded the EA out of the b509-folder - everything works fin except the debugger until I saved it in MQL4/Expert => a little advice of the editor would help as there is nothing from where I can see which is the origin-folder of the file in the editor.

In the reference I find 8 OnWhatever-functions replacing the 3 simple init() start() and deinit() being called by mt4 on start on tick and 'on kill' the basic three mt4-external events.

Only OnCalculate() has an example - there is room to improve at least some links to working scripts, EAs (e.g. OnChartEvent()), or indicators would help a lot!

Gooly

PS:

Beside that the comipler b610 accepted this without an error of warning message:

#property strict
...
if(now=0) now = TimeCurrent();
// now ie euqal 0 here after?
/
To add comments, please log in or register