Hello experts,
please put a look at this indicator code:
Variables: Legend("");
Plot1(123,Legend);
causes compiler error
Wrong plot name or missed ')'
where
Variables: Legend("");
Plot1(123,"Legend");
causes no error.
it seems, that the compiler does not treat var. Legend as string and/or
can't cast to constant string.
anyone know, how to pass string variable values for plot legend anyway ?
plot legend from (implicit) string variable not possible
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
plot is not for string.
you have to use text_new().
you can get the manual, with examples here:
http://www.tssupport.com/support/tutorials/
see middle of right column
you have to use text_new().
you can get the manual, with examples here:
http://www.tssupport.com/support/tutorials/
see middle of right column
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
Re: plot legend from (implicit) string variable not possible
Hi ts2mc,Hello experts,
please put a look at this indicator code:
Variables: Legend("");
Plot1(123,Legend);
causes compiler error
Wrong plot name or missed ')'
where
Variables: Legend("");
Plot1(123,"Legend");
causes no error.
it seems, that the compiler does not treat var. Legend as string and/or
can't cast to constant string.
anyone know, how to pass string variable values for plot legend anyway ?
A variable cannot be used as a plot name. The only way you can use names for plots is as follows:
Code: Select all
plot1(0, "zero plot");
plot2(1, "plot2");