email alert -- Decimal rounding

Questions about MultiCharts and user contributed studies.
jsramek
Posts: 7
Joined: 03 Jan 2012
Has thanked: 2 times

email alert -- Decimal rounding

Postby jsramek » 03 Jan 2012

I created a indicator that sends a email alert saying when to enter and the suggested stop value is the parabolic SAR value but for some reason in the email it will only show to the second decimal place, this works fine for s&p's but not for the currencies, any suggestions ?

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Decimal rounding

Postby JoshM » 03 Jan 2012

Try using the reserved word NumToStr(variable, number of decimals), for example:

Code: Select all

Print("Price of eur/usd: ", NumToStr(Close, 4));
Print("Total volume: ", NumToStr(Volume, 0));
..would give
Price of eur/usd: 1.3064
Total volume: 24204

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

Re: Decimal rounding

Postby sptrader » 03 Jan 2012

another way could be-

Print("Price of eur/usd: ", Close:1:4);

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

Re: email alert -- Decimal rounding

Postby TJ » 03 Jan 2012

he's asking about email alert.

try this:

Code: Select all


Alert( "Price of eur/usd="+ text(Close:1:4) );

jsramek
Posts: 7
Joined: 03 Jan 2012
Has thanked: 2 times

Re: email alert -- Decimal rounding

Postby jsramek » 04 Jan 2012

thanks guys, I used a somewhat of a blend of the above,

if condition1 then alert (Text( "Bullish Entry Signal use following as stop value", NumToStr(value2,6)));


Return to “MultiCharts”