what is wrong here?

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

what is wrong here?

Postby arnie » 26 Feb 2012

Hi.

Using the code...

Code: Select all

text_setstring(dataBoxTXT, " DayHigh " + spaces(4) + " - " + NumToStr(dayHi,decimals) + newline +
" DayLow " + spaces(4) + " - " + NumToStr(dayLo,decimals) + newline +
" DayRange " + spaces(4) + " - " + NumToStr(dayRng,decimals) + newline +
" PrevDayRange " + spaces(4) + " - " + NumToStr(prevDayRng,decimals) + newline +
" AvgDayRange " + spaces(4) + " - " + NumToStr(dayAvgRng,decimals) + newline +
" " + newline +
" OvernightHigh " + spaces(4) + " - " + NumToStr(overnightHi,decimals) + newline +
" OvernightLow " + spaces(4) + " - " + NumToStr(overnightLo,decimals) + newline +
" OvernightRange " + spaces(4) + " - " + NumToStr(overnightRng,decimals) + newline +
" PrevOverRange " + spaces(4) + " - " + NumToStr(prevOverRng,decimals) + newline +
" AvgOverRange " + spaces(4) + " - " + NumToStr(overAvgRng,decimals) + newline +
" " + newline +
" SessionHigh " + spaces(4) + " - " + NumToStr(sessHi,decimals) + newline +
" SessionLow " + spaces(4) + " - " + NumToStr(sessLo,decimals) + newline +
" SessionRange " + spaces(4) + " - " + NumToStr(sessRng,decimals) + newline +
" PrevSessRange " + spaces(4) + " - " + NumToStr(prevSessRng,decimals) + newline +
" AvgSessRange " + spaces(4) + " - " + NumToStr(sessAvgRng,decimals) + newline +
" " + newline +
" PrevDayHigh " + spaces(4) + " - " + NumToStr(prevDayHigh,decimals) + newline +
" PrevDayLow " + spaces(4) + " - " + NumToStr(prevDayLow,decimals));
... I'm trying to align the text using "spaces", but something's wrong. I have the same number of characters for the text, the same "spaces" number, but the result is this:

Image

How can I get those values aligned?

Regards,
Fernando
Attachments
MultiCharts1.png
(33.45 KiB) Downloaded 1052 times

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

Re: what is wrong here?

Postby JoshM » 26 Feb 2012

How can I get those values aligned?
Try using a monospaced font like Courier or Lucida Console (other examples).

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: what is wrong here?

Postby arnie » 26 Feb 2012

How can I get those values aligned?
Try using a monospaced font like Courier or Lucida Console (other examples).
You're the man, you're THE MAN!

:)

Image
Attachments
MultiCharts2.png
(30.22 KiB) Downloaded 1117 times

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: what is wrong here?

Postby arnie » 27 Feb 2012

By the way, using the same code, is it possible to use different colors for the numtostr() inside the text_setstring()?

I'd like to have specific colors for some of the text, but since text_setcolor() needs a text ID I don't know how to to this nor if it's possible to do it.


Return to “User Contributed Studies and Indicator Library”