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

Re: Properties of lines and graphs



PureBytes Links

Trading Reference Links

>From Files section of this board
Optimized Systems
Regards
Jim



//Bollinger Band Swing Trader ***Optimized***

//Enters long/short when a moving average of the lows/highs goes 
outside (below/above) bollinger band.

//Note: Run Optimization first, insert optimized figure in ( Opt1= )
and ( Opt2= ) statements, then ( // ) out optimization line, click on 
backtest.


MA1=MA(L,3);
MA2=MA(H,3);

Opt1=;
Opt2=;
Opt1=Optimize("opt1",14,5,25,4);
Opt2=Optimize("opt2",1,1,2.5,0.5);

p1=MA(L,Opt1)-(Opt2*StDev(L,Opt1));
p2=MA(H,Opt1)+(Opt2*StDev(H,Opt1));

Buy=Ref(MA1,-1) < Ref(p1,-1)AND Ref(MA1,-1) < MA1;
Sell=Ref(MA2,-1) > Ref(p2,-1) AND Ref(MA2,-1) > MA2;
Short=Ref(MA2,-1) > Ref(p2,-1) AND Ref(MA2,-1) > MA2;
Cover=Ref(MA1,-1) < Ref(p1,-1)AND Ref(MA1,-1) < MA1;

Filter=Buy OR Sell OR Short OR Cover;
Buy=ExRem(Buy,Sell); Sell=ExRem(Sell,Buy); Short=ExRem(Short,Cover); 
Cover=ExRem(Cover,Short);

AddColumn(Buy,"Buy");
AddColumn(Sell,"sell");
AddColumn(Short,"short");
AddColumn(Cover,"cover");
















--- In amibroker@xxxx, John Nelson <trader@xxxx> wrote:
> 
> Can I safely "override" the BB indicator that is already there or 
am I 
> applying my own custom indicator and ignoring your "built in"?
> 
> Actually, now that we're on the topic of Bollinger Bands, does 
anyone have 
> any particular AFL based BB trading systems they'd like to post? 
BB's are 
> very useful, particularly in conjunction with candlesticks.
> 
> -- John
> 
> 
> On Sat, 13 Jul 2002, Tomasz Janeczko wrote:
> 
> > Date: Sat, 13 Jul 2002 10:58:20 +0200
> > From: Tomasz Janeczko <amibroker@xxxx>
> > Reply-To: amibroker@xxxx
> > To: amibroker@xxxx
> > Subject: Re: [amibroker] Re: Properties of lines and graphs
> > 
> > John,
> > 
> > The only way to get fatter bollinger bands is to use custom 
formula with thick style:
> > Plot(Close,"Price", 1, 64 );
> > Plot( BBandTop( Close, 15, 2 ), "BBandTop", 2, 4 );
> > Plot( BBandBot( Close, 15, 2 ), "BBandBot", 2, 4 );
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com