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

[amibroker] Re: How to plot lines 10% up and down from zero line of a monthly indicator



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, "john10987654321" <john10987654321@xxx> 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();
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/