Number of decimal places for each symbol output  [SOLVED]

Questions about MultiCharts and user contributed studies.
takehana13
Posts: 5
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: 339
Joined: 03 Dec 2010
Has thanked: 60 times
Been thanked: 90 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),...
These users thanked the author Smoky for the post:
takehana13

User avatar
TJ
Posts: 6874
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 984 times
Been thanked: 1976 times

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

Postby TJ » 19 Dec 2017

takehana13 wrote: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
These users thanked the author TJ for the post:
takehana13


Return to “MultiCharts”