I'm not clear on what it is you are asking for. Are you wanting +/- bands 
surrounding your ROC similar to bollinger bands? Or are you asking for the +/- 
bands but centered on the zero line? Or are you wanting a constant line 
parallel to zero for each of +10 and -10?

Here is an example of all three. Hopefully one will be what you are after. I 
think the second one is what you want.

TimeFrameSet(inMonthly);
MonthlyROC = ROC(Close,10);
TimeFrameRestore();

Expanded = TimeFrameExpand(MonthlyROC, inMonthly);
Delta = abs(Expanded) * 0.10;
Plot(Expanded , "Monthly ROC", colorBlue, styleLine);
Plot(Expanded + Delta, "Plus 10", colorGreen, styleLine);
Plot(Expanded - Delta, "Minus 10", colorDarkRed, styleLine);

Plot(Delta, "Plus 10", colorGreen, styleThick);
Plot(-Delta, "Minus 10", colorDarkRed, styleThick);

Plot(0,"ZERO LINE",colorBlack, styleThick);
Plot(10, "Plus 10", colorGreen, styleThick);
Plot(-10, "Minus 10", colorDarkRed, styleThick);

Mike

--- In [email protected], "john10987654321" <john10987654...@...> wrote:
>
> I have created a monthly ROC indicator and added a zero line to it.
> 
> I would like to plot two lines around the zero line, one 10% up from the ROC 
> at the zero line and another 10% down from the ROC at the zero line. 
> 
> How do I do this? Any help appreciated. 
> 
> // Monthly Rate of Change  
> 
> TimeFrameSet( inMonthly ); // switch to 5 minute frame 
> /* MA now operates on 5 minute data, ma5_13 holds time-compressed 13 bar MA 
> of 5min bars */ 
> MonthlyROC = ROC(Close,10);
> TimeFrameRestore(); // restore time frame to original 
> // plot 
> Plot( TimeFrameExpand( MonthlyROC, inMonthly), "Monthly ROC", colorRed, 
> styleLine); 
> Plot(0,"ZERO LINE",colorBlack,styleThick);
> _SECTION_END();
>


Reply via email to