mt5 strategy tester ticks - page 12

 
WhooDoo22:

"Sorry but I don't understand this sentence."

Thank you

Ok, Value returned is 95.96 because of rounding. That has nothing to do with what we are discussing, see my previous post : it's only output format.
 
angevoyageur:
Ok, Value returned is 95.96 because of rounding. That has nothing to do with what we are discussing, see my previous post : it's only output format.

Alain, I think what threw me off was "e-005". I didn't understand "e" represented exponent and "-005" represented decimal location (decimal moved five places to the right of the decimal's original position).

Thank you

 
WhooDoo22:

Alain, I think what threw me off was "e-005". I didn't understand "e" represented exponent and "-005" represented decimal location (decimal moved five places to the right of the decimal's original location).

Thank you

This not easy to apprehend at first. You can play with this wonderful tool, that helps to understand.

Online Binary-Decimal Converter
  • Francois Grondin
  • www.binaryconvert.com
This converter allows you to convert numbers from decimal format to binary format and from binary format to decimal format. It supports the main variable data types used in most programming languages. It also floating point numbers (single and double precision) according to the standard IEEE754. Supported types are shown in the following table...
 
angevoyageur:

This not easy to apprehend at first. You can play with this wonderful tool, that helps to understand.

Thank you
 
WhooDoo22:

What are your thoughts as to what this "can price != price" issue is?

It is the issue of comparing double values.  Is value1 == value2,  is value3 != value4, is value5 > value6, etc.
 
RaptorUK:
It is the issue of comparing double values.  Is value1 == value2,  is value3 != value4, is value5 > value6, etc.

What are "value1,2,3,4,5's" values? Can you post an example please?

Thank you

 
WhooDoo22:

What are "value1,2,3,4,5's" values? Can you post an example please?

Giving values won't help . . .  read the thread,  do some research,  keep reading until you understand.
 
RaptorUK:
Giving values won't help . . .  read the thread,  do some research,  keep reading until you understand
/*In tester 0.00001000000000006551 returns as 1.000000000006551e-005 and
  
  "NormalizeDouble(0.00001000000000006551,5);" returns as 1e-005.0*/

Comment(NormalizeDouble(0.00001000000000006551,5)); 

value normalized

Value normalized (above).

 Value original

Value original (above).

// desired value return is 0.00001.

Who had the brilliant idea to code the tester to return values in scientific notation? Hmm?  Oh, and why!? Hmm? Documentation (https://www.mql5.com/en/docs/common/comment) reads along the lines of "...depending on what notation will be more compact.". Oh, its compact alright, Hahahahaha! ;)

Has anyone in the MQL5 community solved this problem I wish to solve?

Thank you

 
WhooDoo22:


Value normalized (above).

 

Value original (above).

Who had the brilliant idea to code the tester to return values in scientific notation? Hmm?  Oh, and why!? Hmm? Documentation (https://www.mql5.com/en/docs/common/comment) reads along the lines of "...depending on what notation will be more compact.". Oh, its compact alright, Hahahahaha! ;)

Has anyone in the MQL5 community solved this problem I wish to solve?

Thank you

  • What this has to do with the Tester ?
  • In the same link you post, it's also written :

To output real numbers with another accuracy or in a predefined format, use the DoubleToString() function.

  • The fact is 0.00001 can't be represented accurately in binary format.
 
WhooDoo22:


Who had the brilliant idea to code the tester to return values in scientific notation? Hmm?  Oh, and why!? Hmm? Documentation (https://www.mql5.com/en/docs/common/comment) reads along the lines of "...depending on what notation will be more compact.". Oh, its compact alright, Hahahahaha! ;)

Has anyone in the MQL5 community solved this problem I wish to solve?

Maybe it's me . . .  but it appears that we suggest that you read something that will help you,  and you say "OK - I will" and then you promptly go away and do something else . . . then come back here and forget everything that was written in this thread to help you.

Do you remember this post ?

RaptorUK:


 

If you want to see 0.00001000000000xyz then use DoubleToStr() to format the output to your liking.

 or this . . .

 

RaptorUK:

So you mean something like this ?

double value = 95.959;

Print("Value: ", DoubleToStr(value, _Digits - 1) );

 Can price != price is a different, but slightly connected,  issue.  It can't really be solved,  first you need to understand what the issue is . . . then you work around it. 

Reason: