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

[amibroker] Plotting Price Bands



PureBytes Links

Trading Reference Links

Hi all,

I'm attempting to plot 21 day price bands using some width parameter
based on the ATR.  However, the code below produces a continuous plot
which looks like a price channel.  I only want to plot the horizontal
channel if the range is tight, looking for breakouts from horizontal
consolidation patterns.  My sense is my logic is wrong based on not
fixing the value of the top and bottom channel lines.  They are
dynamic.  Any thoughts?  Thanks.

Code:

BBand = Ref(LLV(L,21), -1);
TBand = Ref(HHV(H,21), -1);
Range = ATR(21);
Test = IIf((TBand - BBand) < Range, 1,0);
if(Test = 1){
Plot(BBand, "BBand", colorRed, styleThick);
Plot(TBand, "TBand", colorRed, styleThick);
Buy_Test = IIf(C > TBand, 1, 0);
Buy = Buy_Test AND C >2 AND C < 30 AND MA(V,40) > 50000;
}



Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html
 
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/