I figured out how to change the color to red when ROC is negative.
The following is a reworked version:
if (SelectedValue( ROC(C,1)) < 0 )
ROCFormat = EncodeColor(colorRed ) + SelectedValue( ROC(C,1) );
else
ROCFormat = EncodeColor(colorBlack ) + SelectedValue( ROC(C,1) );
Title = Interval(2) + " - " + Date() + " - " + Name() + " - "+
FullName() + " - " + _DEFAULT_NAME() + "\n" +
StrFormat("Open: %g, Hi: %g, Lo: %g, Close: %g Vol: " +
WriteVal( V, 1.0 ) , O, H, L, C ) + " " +
ROCFormat + EncodeColor(colorBlack );
--- In [email protected], "tipequity" <[EMAIL PROTECTED]> wrote:
>
> Does anybody know if there is way to change the color of ROC to red
> and character type to bold if it has a negative value in the
> following statement? TIA
>
> _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi
%
> g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +"
{{VALUES}}",
> O, H, L, C, SelectedValue( ROC( C, 1 )) ));
>
> --- In [email protected], "tipequity" <l3456@> wrote:
> >
> > I have seen in the user guide and in the AB supplied indicator
code
> > that TJ uses the following line of code to format chart title:
> >
> > _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g,
Hi %
> g,
> > Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +"
{{VALUES}}",
> O,
> > H, L, C, SelectedValue( ROC( C, 1 )) ));
> >
> > I was not able to find any information on using the double curly
> > braces "{{ }}". Would someone please refer me to a source?
> >
>