Could I define the result report precision within code

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Could I define the result report precision within code

Postby arjfca » 18 Mar 2012

Hello

I got indicator that capture and plot the high of the previous day. On my data window, I got the resulting number = 1. To read the proper value, i need to format that Indicator to have a 5 digit after 0 precision. Otherwise, the appear result equal 1

My goal is to have it coded inside the indicator. The same one is use all over every charts that I use and in each of them, i need to format the precision.

A good day to all

Martin

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: Could I define the result report precision within code

Postby sptrader » 18 Mar 2012

When I do a print statement for example , I set the precision this way:

Print(date,",",time,",","Close=",Close:1:4);
For Forex-(Eurusd) this will result in a price like 1.3176 .
You would probably use something like close:1:5 (5 represents the number of digits to the right of the decimal, the 1 represents the number of digits to the left of the decimal).

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Could I define the result report precision within code

Postby arjfca » 18 Mar 2012

Hello Sptrader

I do use the format like you wrote for my print out or file writing. My interrogation if for the data in the Data Windows box.

When i plot or do some calculation and I read the result in the data window, in need to modify from the indicator property the number of digit after the 0. I'm looking to embedded in the code this format.

Martin


Return to “MultiCharts”