MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Automated Trading and Strategy Testing Forum

Update to MetaTrader 4 build 735 and Test the VPS for Free
To add comments, please log in or register
Do you keep a blog? Place a link to MQL5.community there and make money!
Simon Gniadkowski
Moderator
4022
RaptorUK 2013.04.12 19:37
WhooDoo22:

1.000000000006551e-005's sixteenth place to the right of the decimal is e-005.

Are you saying 1.000000000006551e-005 doesn't have an exact binary representation because its sixteenth place to the right of the decimal isn't an integer, its e-005?

Read this too:  http://en.wikipedia.org/wiki/Scientific_notation  all of it.
Scientific notation - Wikipedia, the free encyclopedia
  • en.wikipedia.org
Scientific notation (commonly referred to as "standard form") is a way of writing numbers that are too big or too small to be conveniently written in decimal form. Scientific notation has a number of useful properties and is commonly used in calculators and by scientists, mathematicians and engineers. Standard decimal notation Normalized...
Big Data Needs Data Scientists, Or Quants, Or Excel Jockeys
Men are often capable of greater things than they perform. They are sent into the world with bills of credit, and seldom draw to their full extent. To get the greatest business value from Big Data, companies are looking for multi-skilled experts who understand programming, large-scale mathematics, statistics and business. They call this new role a...
Simon Gniadkowski
Moderator
4022
RaptorUK 2013.04.12 19:40
WhooDoo22:

"this is how double values are stored"

Double values such as 1.5737300000000001 are stored as 1.57373 (if normalize double is used I assume). If normalize double isn't used, the double value 1.5737300000000001 would keep this value format, correct?

You need to read what people write . . .

"while NormalizeDouble(1.57373, 5) might produce a double value of  1.5737299999999999  "   not 1.57373

"and often the value held is not exactly the same as the value that you think is being held." 

Nathan
334
WhooDoo22 2013.04.13 06:30
RaptorUK:
Read this too:  http://en.wikipedia.org/wiki/Scientific_notation  all of it.

I'm reading this (http://en.wikipedia.org/wiki/Scientific_notation) and am wondering why there's so much text explaining scientific notation, its unnecessary - for instance


"Scientific notation is a way of writing numbers that are too big or too small to be conveniently written in decimal form. Scientific notation has a number of useful properties and is commonly used in calculators and by scientists, mathematicians and engineers.

In scientific notation all numbers are written in the form of"

a*10^b  and (a times ten raised to the power of b) THE END! I'd a put this at the very top above everything else. Background info belongs below.

, where the exponent b is an integer, and the coefficient a is any real number (however, see normalized notation below), called the significand or mantissa. The term "mantissa" may cause confusion, however, because it can also refer to the fractional part of the common logarithm. If the number is negative then a minus sign precedes a (as in ordinary decimal notation).

I'll apply an analogy, "as difficult as finding a needle in a haystack". Combining text with calculations can complicate things. If text and calculations must be combined to explain an arithmetical calculation then the ratio should be 5-10 percent (text) to 90-95 percent (calculations). The article was informative so I can't complain but it's manner of placing "a*10^b  and (a times ten raised to the power of b)" in and amongst so much other data can confuse a reader. Background information is most helpful but should be placed below on a page so a reader won't feel like a mouse in a maze (where's the cheese!?). Hahahaha! ;)

Thank you

Scientific notation - Wikipedia, the free encyclopedia
  • en.wikipedia.org
Scientific notation (commonly referred to as "standard form") is a way of writing numbers that are too big or too small to be conveniently written in decimal form. Scientific notation has a number of useful properties and is commonly used in calculators and by scientists, mathematicians and engineers. Standard decimal notation Normalized...
Alain Verleyen
Moderator
16487
angevoyageur 2013.04.13 10:22
WhooDoo22:

I'm reading this (http://en.wikipedia.org/wiki/Scientific_notation) and am wondering why there's so much text explaining scientific notation, its unnecessary - for instance

...

This not the right place to post such a comment. Wikipedia as a wiki ;-), you can participate on the elaboration of the content.


Nathan
334
WhooDoo22 2013.04.14 01:24

Hello MQL5 community,

http://www.mql5.com/en/docs/common/comment

"Data of double type are output with the accuracy of up to 16 digits after a decimal point, and can be output either in traditional or in scientific format, depending on what notation will be more compact. Data of float type are output with 5 digits after a decimal point. To output real numbers with another accuracy or in a predefined format, use the DoubleToString() function."

USDJPY's price representation in 98.370 is data of float type (output at 5 digits after decimal).

USDJPY's price representation in -0.001999999999995339 is data of double type, traditional format (output at up to 16 digits after decimal).

Why does double -0.00199999999999533[9] return an 18th digit after the decimal if a double output is only up to 16 digits after the decimal?

Thank you

Documentation on MQL5: Common Functions / Comment
Documentation on MQL5: Common Functions / Comment
  • www.mql5.com
Common Functions / Comment - Documentation on MQL5
Alain Verleyen
Moderator
16487
angevoyageur 2013.04.14 09:39
WhooDoo22:

Hello MQL5 community,

http://www.mql5.com/en/docs/common/comment

"Data of double type are output with the accuracy of up to 16 digits after a decimal point, and can be output either in traditional or in scientific format, depending on what notation will be more compact. Data of float type are output with 5 digits after a decimal point. To output real numbers with another accuracy or in a predefined format, use the DoubleToString() function."

USDJPY's price representation in 98.370 is data of float type (output at 5 digits after decimal).

USDJPY's price representation in -0.001999999999995339 is data of double type, traditional format (output at up to 16 digits after decimal).

Why does double -0.00199999999999533[9] return an 18th digit after the decimal if a double output is only up to 16 digits after the decimal?

Thank you

Prices are always double, 98.370 is a double. There are 16 significant digits. Zeros are not significant.
Simon Gniadkowski
Moderator
4022
RaptorUK 2013.04.14 16:17
RaptorUK:
Very possibly,  just tried that for the first time yesterday.  Need to understand which files to backup and the consequences of copying older files back into the terminal and if it's possible to copy the history from a different Broker.  I'll do some testing . . .

I closed down MT5,  backed up my Bases folder,  then copied my EURUSD folder from Broker 1 to Broker 2,  I restarted MT5 logged in to my Broker 2 account and I now have the History from Broker 1 working with my Broker 2,  also this History is used with the Strategy tester and my symbol properties are correct for my Broker 2.  

So this is good news and is a way forward for me using M1 and above data . . .

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Symbol Properties - Documentation on MQL5
Nathan
334
WhooDoo22 2013.04.14 17:28
RaptorUK:

I closed down MT5,  backed up my Bases folder,  then copied my EURUSD folder from Broker 1 to Broker 2,  I restarted MT5 logged in to my Broker 2 account and I now have the History from Broker 1 working with my Broker 2,  also this History is used with the Strategy tester and my symbol properties are correct for my Broker 2.  

So this is good news and is a way forward for me using M1 and above data . . .

Why did you swap broker history? Congrats to you for your accomplishment.

Thank you

Nathan
334
WhooDoo22 2013.04.14 17:36
angevoyageur:
Prices are always double, 98.370 is a double. There are 16 significant digits. Zeros are not significant.

Yes, of course :)

Thank you

Simon Gniadkowski
Moderator
4022
RaptorUK 2013.04.14 17:52
WhooDoo22:

Why did you swap broker history? Congrats to you for your accomplishment.

 I want to be able to control the History Data I use so that I can repeat tests (Strategy Tester) under controlled conditions.

/ /1...3456789101112131415
To add comments, please log in or register