Expert initialization failed by using MathArctan2\atan2

 
I can't test or run expert advisor Whenever I use MathArctan2\atan2.

I use Print(MathArctan2(-10,10) or atan2 (-10,10)).

Btw the first parameter of this formula is y in MQL5 Refrence, but x is the first parameter in the signature of function...
 
William Roeder #:

Perhaps you should read the manual. Arctan only takes one parameter, as does every other Math Function. There is no arctan2.
   How To Ask Questions The Smart Way. (2004)
      How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.

mql5 !
 
William Roeder #:

Perhaps you should read the manual. Arctan only takes one parameter, as does every other Math Function. There is no arctan2.
   How To Ask Questions The Smart Way. (2004)
      How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.

Perhaps you should read the manual. Arctan2 takes two parameters. 🤣 Just messing with you William!

 
pavelion: I can't test or run expert advisor Whenever I use MathArctan2\atan2. I use Print(MathArctan2(-10,10) or atan2 (-10,10)). Btw the first parameter of this formula is y in MQL5 Refrence, but x is the first parameter in the signature of function...

Can you please provide sample code where that happens to you please, so that we can replicate the problem?

I just tried the following and it printed with no problem on MT5 build 3210:

int OnInit()
{
   Print( "ArcTan2: ", MathArctan2( -10, 10 ) );
   return(INIT_SUCCEEDED);
};
2022.02.12 21:22:42.086 TestArctan2 (AUDCAD,H1) ArcTan2: -0.7853981633974483
 
Fernando Carreiro #:

Perhaps you should read the manual. Arctan2 takes two parameters. 🤣 Just messing with you William!

 
Alain Verleyen #: mql5 !

My apologies. I thought I did bring up the 5 docs.

 
Fernando Carreiro #:

Can you please provide sample code where that happens to you please, so that we can replicate the problem?

I just tried the following and it printed with no problem on MT5 build 3210:

I've just created a new template, and added yours to OnInit(). Still get the same error.


#property copyright "Copyright 2022, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"



int OnInit(){
   Print( "ArcTan2: ", MathArctan2( -10, 10 ) );   
   return(INIT_SUCCEEDED);
}



void OnDeinit(const int reason){
   
}



void OnTick(){
   
}


2022.02.13 10:37:15.712 2022.01.01 00:00:00   EX5 loading failed
2022.02.13 10:37:15.712 global initialization failed
2022.02.13 10:37:15.712 global initialization critical error
2022.02.13 10:37:15.712 tester stopped because expert initialization failed
2022.02.13 10:37:15.739 test Experts\qweqw.ex5 on EURUSD,M1 thread finished
2022.02.13 10:37:15.777 prepare for shutdown
 
pavelion #: I've just created a new template, and added yours to OnInit(). Still get the same error.

Don't use a template or other code, as there may be other things there messing things. Open a clean chart, and add my EA as is to it, and show the results.

EDIT: Also, what log output are you showing (Experts or Journal)? I don't recognise your output format for either. If its the Tester, it still does not seem in the format I usually see? Or is the log from an Test Agent?

Files:
 
Fernando Carreiro #:

Don't use a template or other code, as there may be other things there messing things. Open a clean chart, and add my EA as is to it, and show the results.

EDIT: Also, what log output are you showing (Experts or Journal)? I don't recognise your output format for either. Are you perhaps running this on MT4 Strategy Tester?

No Success
Files:
ewqe.png  31 kb
 
pavelion #: No Success

Something seems wrong on your setup. What build are you using?


Please show the full Journal log output of the run in the Visual tester, as well as the Journal and Expert log output when attaching it to the terminal chart directly (not via tester).

 
Fernando Carreiro #:

Something seems wrong on your setup. What build are you using?


Please show the full Journal log output of the run in the Visual tester, as well as the Journal and Expert log output when attaching it to the terminal chart directly (not via tester).

I'm using build 2361.

It only happens when I'm using MathArctan2/atan2 function.

I can use MathArctan/atan function without problem...

Files:
Untitled.png  41 kb
20220213.log  3 kb
Reason: