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

RE: [amibroker] Time vs Tick Baesd charts



PureBytes Links

Trading Reference Links

Hi ken,

This may be more than you bargained for, but here are two envelopes plotted
around price. I derived this from Headley's 'Big Trends in Trading' book.

-john

/*Acceleration Bands....from Headley: another setup I now look for is a
fresh cross of the Bollinger Bands outside of my Acceleration Bands to
confirm a breakout.
*/
//UpperBands
uab= MA((H*(1+2*((((H-L)/((H+L)/2))*1000)*.001))),20);
ubb=BBandTop(C,20,2);
//MidBand
mb= MA(C,20);
//LowerBands
lab = MA((L*(1-2*((((H-L)/((H+L)/2))*1000)*.001))),20);
lbb= BBandBot(C,20,2);
bcond0= ubb > uab;
bcond1=Ref(C,-1)>Ref(uab,-1);
bcond2=C > uab;
bcond3=C > Ref(C,-1);
bcond4=ADX(14) > Ref(ADX(14),-1) AND Ref(ADX(14),-1) > Ref(ADX(14),-2);
bcond5=StochK(21,21) > 80;
bcond6=MFI(10) > 80;
b12=bcond1 AND bcond2;
b456=bcond4 AND bcond5 AND bcond6;
Buy=bcond0 AND bcond1;
// AND bcond2 AND bcond3 AND bcond4;
scond0=Ref(C,-1)<Ref(uab,1) AND C < uab;
scond1=Ref(C,-1) < Ref(uab,-1);
scond2=C < uab;
scond3=C < Ref(C,-1);
scond4=ADX(14) < Ref(ADX(14),-1) AND Ref(ADX(14),-1) < Ref(ADX(14),-2);
scond5=StochK(21,21) < 80;
scond6=MFI(10) < 80;
scond7=C < mb;
Sell=scond7;
// OR scond2 OR scond3 OR scond4;
// AND scond2 AND scond3 AND scond4;
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
//for short and long system
//Filter = Buy OR Sell OR Short OR Cover;
//for long-only system
Filter = Buy OR Sell;
Plot(Close,"Close",colorBlack, styleCandle);
Plot(uab,"UpAccBand",colorGreen,styleLine|styleThick);
//Plot(ubb,"UpBollBand",colorRed,styleLine|styleThick);
Plot(mb,"MidBand",colorBlue,styleLine);
//Plot(lab,"LowAccBand",colorRed,styleLine|styleThick);
Plot(lbb,"LowBollBand",colorGreen,styleLine|styleThick);
PlotShapes( IIf( Buy, shapeUpArrow, shapeNone ), colorGreen,0,Graph1,-24 );
PlotShapes( IIf( Sell, shapeDownArrow, shapeNone ), colorRed,0,Graph1,-24);
Title=Name()+" Close="+WriteVal(C,1.2)+" "+Date()+ EncodeColor(colorGreen)+"
UAB="+WriteVal(uab,1.2)+EncodeColor(colorRed)+"
UBB="+WriteVal(ubb,1.2)+EncodeColor(colorBlack)+" Volume="+WriteVal(V,1.0);
GraphXSpace=5;
----- Original Message ----- 
From: "k_binder_" <k_binder_@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, July 30, 2004 6:18 PM
Subject: [amibroker] overlaying price envelopes on a price chart



How can I overlay a custom price envelope on a price chart like the
built-in bollinger bands?

The Plot statement plots it in a different chart.

Any help from the experts here is appreciated.

ken





Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

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

<*> 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/