[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coding questing regarding plot statements



PureBytes Links

Trading Reference Links

Alexandra:
>i need 5 plot statements in one indicator.

I've done this.  There are two ways.  Hard way: use trendlines (not
trivial in an indicator, but easy on a price chart). Easy way: use
dotted lines.

>i just want to draw an RSI with 4lines ( not only 70 /
>30 but also 80 /20). at the moment i have to use two
>indictors but i think i have seen solutions where i
>could plot more than 4 lines. ( some if statements
>would do this)

Plot your 70/30 lines as dashed lines.  They don't need to be solid.
All you need to do is plot a tick mark at 70 if the barnumber is even,
and 30 if the barnumber is odd.  Do the same for 80 and 20.  There!  Now
you have four levels plotted, with only two plot statements, and you
have two left over for the indicator.

Example:

plot1(iff(mod(barnumber,2)=0,80,20), "levels");

-Alex