Number of decimal places for each symbol output  [SOLVED]

Questions about MultiCharts and user contributed studies.
takehana13
Posts: 9
Joined: 20 Nov 2017
Has thanked: 5 times

Number of decimal places for each symbol output

Postby takehana13 » 19 Dec 2017

I ran the following code

Code: Select all

Print(File("Mypass"),Date,Time,Open,High,Low,Close );
When applying this script to the euro doll, the OHLC becomes like 1.10, 1.10, 1.10, and so on.
Is there a way to read the number of decimal places for each symbol and output it to a file?

Thanks.

User avatar
Smoky
Posts: 507
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 97 times
Been thanked: 115 times

Re: Number of decimal places for each symbol output

Postby Smoky » 19 Dec 2017

Take a look :

NumToStr
Returns a specified numerical expression in the form of a string expression.

Usage
NumToStr(Expression,Dec)

Where: Expression - a numerical expression to be converted to a string expression
Dec - a numerical expression specifying the number of decimal places the returned string expression is to contain

Example
NumToStr(1500.5,3); will return a string expression "1500.500"

Code: Select all

NumToStr(low,5),...

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Number of decimal places for each symbol output  [SOLVED]

Postby TJ » 19 Dec 2017

I ran the following code

Code: Select all

Print(File("Mypass"),Date,Time,Open,High,Low,Close );
When applying this script to the euro doll, the OHLC becomes like 1.10, 1.10, 1.10, and so on.
Is there a way to read the number of decimal places for each symbol and output it to a file?

Thanks.

Go to wiki

Go to 8. PowerLanguage Keyword Reference

Look under ► Output‎ (8 P)

Select Print

Look for the explanation of
Expression:C:D

Examples are provided


Return to “MultiCharts”