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

[amibroker] email response



PureBytes Links

Trading Reference Links

This morning I sent you what is called in trade circles a 
Janeczko-gram: Short ( 4 words), to the point, but perhaps not 
addressing the implied questions or broader perspective. So I will 
expand a bit.
1. Price Headley: To facilitate visualization I have included 2 
indicators with vertical lines that show the locations of the actual 
Buy and Sell conditions. They are nearly identical except that one 
shows all buy and sell conditions and the other only includes those 
Sell conditions that are preceeded by a Buy condition.  Put the two 
together with the other indicator in the previous email on 1 tab and 
play with the params.  In a short time you will see what works and 
not, the simularity with shifted MA Bands and the comparison wrt to BB 
bands.
I don't use PH, because it gets in late and also out late. It is meant 
for well-trending stocks, what I call O'Neal stocks(IBD,"buy, high, 
sell higher"). That approach works fine in a strong bull market, but 
eats your lunch anywhere else. Regardless, you only see the tip of the 
iceberg and leave a lot of profits on the table. For example, after 
analysis of the IBD100 stocks for a period of 13 months, I concluded 
that in 96% of the cases I would have been in weeks/months earlier and 
out also much earlier. In addition, I would have invested in only 15% 
of the stocks because there were many more interesting short term 
opportunities. Whereas 5 years ago, the avg buy and hold still was 4-5 
years, currently the avg is 4-5 months. My shortest buy and hold has 
been 12 sec (the socalled "Shoot,too late" category.  PH entry and 
exit points can be improved by reducing the BWRatio and the PerMAPH.
2. Bollinger Bands. Some people enter when the close  is above the top 
band. Here again, I feel that you give up way too much without any 
assurance of improved return. I try always to get in near  the minimum 
or short near the maximum. So every now and then you get stopped out.  
So what? You lose very little. Commissions are hardly a consideration 
anymore, even when daytrading. The times that you paid 4-6% for a 
roundtrip to your full-service broker are over. There is no dent in 
your wallet,  only  in your ego. ( If you get stopped out 8 times in a 
row, though, as has happened to me once, you feel like an idiot, even 
though the loss was negligible. You have to remind yourself that you 
are a lot smarter than those traders with the strategically placed 8% 
losses and keep plowing. Coincidentally, the next day I had the best 
day of that year.
I use the BB bands primarily for visualization of volatility, to alert 
me to low volatility (the silence before the storm) and to remind me 
of where the close is wrt to the bands. It is a very good way of 
assessing the potential risk/reward.  If you are interested in BB, 
among the books I liked were: 
1. Bollinger on Bollinger bands, John Bollinger, 2002 and 2. Dynamic 
technical analysis,Philippe Cahen, 2001 (He carries it a little bit 
far, but you get ideas of how to implment your own ideas).  Also, even 
though PHformula was kind of outrageous, the book itself is actually 
pretty readable. 3. Big trends in trading : strategies to master major 
market moves /Price Headley, 2002.

//====================================================================
===

//Indicator 1. Prior Buy Condition Restriction for Sell signal

// 3.Price Headley formulas simplified; generalized with additional 
PARAMS
//Acceleration Bands-Price Headley-Formula Test
MaxGraph = 10;
Graph0Style=Graph1Style=Graph2Style=Graph3Style=Graph4Style=Graph5Styl
e=Graph6Style=Graph7Style=Graph8Style=1;
Graph0Color = Graph1Color = Graph2Color = 7;Graph3Color = Graph4Color 
= Graph5Color = 6; Graph6Color =Graph7Color = Graph8Color = 1;
Plot(C,"C",1,64);
ConstBWR = Param("ConstBWR",4,1,10,0.5);
PerMAPH= Param("PerMAPH",20,2,30,1);
BWRatio = (H-L)/(H+L) ;
UpperBand = MA(H*(1+COnstBWR*BWRatio),PerMAPH);
MidBand = MA(C,PerMAPH);
LowerBand = MA(L*(1- COnstBWR*BWRatio),PerMAPH);
Graph3 = UpperBand ; //Blue
Graph4 = MidBand ;
Graph5 = LowerBand ;
//=======================================
C1 = Ref(C,-1); C2 = Ref(C,-2); 
UpperBand1 = Ref(UpperBand,-1); UpperBand2 = Ref(UpperBand,-2); 
UpperBandDiff = C - UpperBand; UpperBandDiff1 = C1 - UpperBand1; 
UpperBandDiff2 = C2 - UpperBand2;
BuyCond = IIf(C>UpperBand  AND C1>UpperBand1  AND C2<UpperBand2,1,0);
Sellcond = IIf(C1>UpperBand1  AND  C<UpperBand,2,0);
Title = EncodeColor(1) +"Price Headley Formula Test - Prior Buy 
Condition" +"\n            C2 = " + WriteVal(C2,2.2) +";   C1 = "  + 
WriteVal(C1,2.2) +";    C = " + WriteVal(C,2.2)  + "; "  
+"\nPH - UB2 = " + WriteVal(UpperBand2 ,2.2) +"; UB1 = " + 
WriteVal(UpperBand1 ,2.2) +"; UB = " + WriteVal(Graph3 ,2.2) +";" 
+"\nDist Above UpperBand; \nUBDiff2 = " + WriteVal(UpperBandDiff2 ,2.
2) +"; UBDiff1 = " + WriteVal(UpperBandDiff1 ,2.2) +"; UBDiff = " + 
WriteVal(UpperBandDiff ,2.2) +";"; 
//Use the FLIP command to remove extraneous Sell signals: 2 Methods, 
just to provide some flavor
/*
//Method1
BuyFlip = Flip(BuyCond ,Sellcond ); BuyCond3 = IIf( BuyFlip AND 
Ref(BuyFlip ,-1)==0,1,0);
SellFlip = Flip(Sellcond,BuyCond  ); SellCond3 = IIf( SellFlip AND 
Ref(SellFlip ,-1)==0,1,0); 
Plot(BuyCond3 ,"BuyCond ",5,styleHistogram|styleOwnScale|styleNoLabel)
;
Plot(SellCond3 ,"SellCond ",4,
styleHistogram|styleOwnScale|styleNoLabel);
*/
//Method2
BuySellFlip = Flip(Sellcond,BuyCond  ); 
BuySellFlip2 = IIf( BuySellFlip != Ref(BuySellFlip ,-1),1,0);
PlotColor = IIf(BuyCond ,5,4);
Plot(BuySellFlip2 ,"BuyCond-SellCond ",PlotColor ,
styleHistogram|styleOwnScale|styleNoLabel);
//====================================================================
==============================================
//Indicator 2.No Prior Buy Condition Restriction for Sell signal
// 3.Price Headley formulas simplified; generalized with additional 
PARAMS
//Acceleration Bands-Price Headley-Formula Test
MaxGraph = 10;
Graph0Style=Graph1Style=Graph2Style=Graph3Style=Graph4Style=Graph5Styl
e=Graph6Style=Graph7Style=Graph8Style=1;
Graph0Color = Graph1Color = Graph2Color = 7;Graph3Color = Graph4Color 
= Graph5Color = 6; Graph6Color =Graph7Color = Graph8Color = 1;
Plot(C,"C",1,64);
ConstBWR = Param("ConstBWR",4,1,10,0.5);
PerMAPH= Param("PerMAPH",20,2,30,1);
BWRatio = (H-L)/(H+L) ;
UpperBand = MA(H*(1+COnstBWR*BWRatio),PerMAPH);
MidBand = MA(C,PerMAPH);
LowerBand = MA(L*(1- COnstBWR*BWRatio),PerMAPH);
Graph3 = UpperBand ; //Blue
Graph4 = MidBand ;
Graph5 = LowerBand ;
C1 = Ref(C,-1); C2 = Ref(C,-2); 
UpperBand1 = Ref(UpperBand,-1); UpperBand2 = Ref(UpperBand,-2); 
UpperBandDiff = C - UpperBand; UpperBandDiff1 = C1 - UpperBand1; 
UpperBandDiff2 = C2 - UpperBand2;
BuyCond = IIf(C>UpperBand  AND C1>UpperBand1  AND C2<UpperBand2,1,0);
Sellcond = IIf(C1>UpperBand1  AND  C<UpperBand,2,0);
Title = EncodeColor(1) +"Price Headley Formula Test - No Prior Buy 
Condition Restriction" +"\n            C2 = " + WriteVal(C2,2.2) +"; 
C1 = "  + WriteVal(C1,2.2) +"; C = " + WriteVal(C,2.2)  + "; "  
+"\nPH - UB2 = " + WriteVal(UpperBand2 ,2.2) +"; UB1 = " + 
WriteVal(UpperBand1 ,2.2) +"; UB = " + WriteVal(Graph3 ,2.2) +";" 
+"\nDist Above UpperBand; \nUBDiff2 = " + WriteVal(UpperBandDiff2 ,2.
2) +"; UBDiff1 = " + WriteVal(UpperBandDiff1 ,2.2) +"; UBDiff = " + 
WriteVal(UpperBandDiff ,2.2) +";"; 
Plot(BuyCond ,"BuyCond ",5,styleHistogram|styleOwnScale|styleNoLabel);
Plot(SellCond ,"SellCond ",4,
styleHistogram|styleOwnScale|styleNoLabel);



--- In amibroker@xxxxxxxxxxxxxxx, "Steve Almond" <steve2@xxxx> wrote:
> Now that is an excellent, educational post!
> 
> 1. Can you read 4. again and confirm the sell signal is triggered by 
a close
> below the TOP band?
> 2. Do you use Bollinger bands in the same way as described above?
> 
> Steve
> 
> 
> 
> ----- Original Message ----- 
> From: "jmschuller" <jmschuller@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Wednesday, June 23, 2004 8:44 PM
> Subject: [amibroker] Acceleration bands - Price-Hadley
> 
> 
> > Recently there was quite some interest in and confusion about 
Price
> > Headley Acceleration Bands: Where to find info, the formulas and 
how
> > to apply them
> > 1. To find: Nowadays often the easiest way to find this type of 
info
> > is by going to Google and search keywords,e.g. "acceration bands" 
(in
> > Opera, the search bar is next to the addressbar;  incidentally 
Opera
> > is superior to IE in many aspects and also somewhat faster).
> > 2. Formulas: The bands are described extensively in "Big trends in
> > trading : strategies to master major market moves / Price Headley,
> > 2002",on pg.91 and on
> > 3. Application: The bands are meant for well trending stocks with
> > solid earnings growth (25%), in short for well behaved stocks that
> > respond well to a host of other indicators too.
> > 4. A Buy signal occurs after 2 closes above the top band and a 
Sell
> > signal after a close below it.
> > 5. The original formulas are:
> > UpperBand = MA((H*(1+2*((((H-L)/((H+L)/2))*1000)*0.001))),20);
> > MidBand = MA(C,20);
> > LowerBand = MA((L*(1-2*((((H-L)/((H+L)/2))*1000)*0.001))),20);
> > 6. This hard-to-decipher formula is unnecessary complicated and 
can be
> > easily reduced to a straightforward form:
> > BWRatio = (H-L)/(H+L) ; //BandWidth Ratio
> > UpperBand = MA(H*(1+4*BWRatio),20);
> > LowerBand = MA(L*(1-4*BWRatio),20);
> > 7. From the simplified, but equivalent formulas, one can easily
> > determine, that acceleration is predominantly caused by the Center
> > Band behavior, not by the Top and Bottom bands. Also although a 
trend
> > technique, the late Buy and Sell entries  force loss of a large
> > portion of the trend
> > 8. Essentially, the bands are part of a family of MA-based 
Top/Bottom
> > Bands shifted wrt to the Center MA band
> > 9. In fact, the Buy and Sell points are often identical to those
> > derived from a MA Center band with Percentage offset from the 
Center:
> > e.g. (100-Const.)/100*MA,(100+Const.)/100*MA.
> > 10. Bands based on a statistical criterion (e.g. Std Dev, ATR) 
such as
> > BB bands in general provide earlier Buy and Sell signals.
> > 11. The impact of the various parameters can be easily visualized 
with
> > the PARAM feature (AB4.25 and up)
> > 12. To verify above statements and of course also for play and
> > comparison, below some simple indicator code containing:
> >     1. Original Price headley formulas
> >     2. Price Headley formulas simplified (by removing unnecessary
> > parentheses and factors)
> >     3. Price Headley formulas simplified; (generalized with 
PARAMS)
> >     4. MA Bands offset from Center MA Band (with PARAMS)
> >     5. Bollinger Bands (with PARAMS)
> >
> > 
//====================================================================
> > ========================================================
> > //Acceleration Bands-Price Headley
> > MaxGraph = 10;
> > 
Graph0Style=Graph1Style=Graph2Style=Graph3Style=Graph4Style=Graph5Styl
> > e=Graph6Style=Graph7Style=Graph8Style=1;
> > Graph0Color = Graph1Color = Graph2Color = 7;Graph3Color = 
Graph4Color
> > = Graph5Color = 6; Graph6Color =Graph7Color = Graph8Color = 1;
> > Plot(C,"C",1,64);
> > // 1. Original Price headley formulas
> > UpperBand = MA((H*(1+2*((((H-L)/((H+L)/2))*1000)*0.001))),20);
> > MidBand = MA(C,20);
> > LowerBand = MA((L*(1-2*((((H-L)/((H+L)/2))*1000)*0.001))),20);
> > //=========================================
> > Graph0 = UpperBand ; //Yellow
> > Graph1 = MidBand ;
> > Graph2 = LowerBand ;
> > /*
> > 2.Price Headley formulas simplified (by removing unnecessary
> > parentheses and factors)
> > BWRatio = (H-L)/(H+L) ; //BandWidth Ratio
> > UpperBand = MA(H*(1+4*BWRatio),20);
> > LowerBand = MA(L*(1-4*BWRatio),20);
> > */
> > //=========================================
> > // 3.Price Headley formulas simplified; generalized with 
additional
> > PARAMS
> > ConstBWR = Param("ConstBWR",4,1,10,0.5);
> > PerMAPH= Param("PerMAPH",10,2,30,1);
> > BWRatio = (H-L)/(H+L) ;
> > UpperBand = MA(H*(1+COnstBWR*BWRatio),PerMAPH);
> > MidBand = MA(C,PerMAPH);
> > LowerBand = MA(L*(1- COnstBWR*BWRatio),PerMAPH);
> > Graph3 = UpperBand ; //Blue
> > Graph4 = MidBand ;
> > Graph5 = LowerBand ;
> > //=========================================
> > // 4. MA Bands
> > OffsetPerc= Param("Offset Perc.",15,0,50,1);
> > PeriodMA = Param("PeriodMA",10,2,30,1);
> > UpperBand = (1+OffsetPerc/100 )* MA(C,PeriodMA);
> > MidBand = MA(C,PeriodMA);
> > LowerBand =(1-OffsetPerc/100 )* MA(C,PeriodMA);
> > Graph6 = UpperBand ; //Black
> > Graph7 = MidBand ;
> > Graph8 = LowerBand ;
> > //==========================================
> > // 5. Bollinger Bands
> > BBStdDev = Param("BBStdDev",2,0.5,3,0.5);
> > //BBStdDev = Param("BBStdDev",2,0.25,4,0.25);
> > BBPeriod = Param("BBPeriod ",10,5,30,1);
> > //BBTop = BBandTop(C,BBPeriod ,BBStdDev);
> > //BBBottom = BBandBot(C,BBPeriod ,BBStdDev);
> > BBTop = BBandTop(H,BBPeriod ,BBStdDev);// I often use the H and L
> > instead of C
> > BBBottom = BBandBot(L,BBPeriod ,BBStdDev);
> > Plot(BBTop ,"BBTop ;",2,1); //White
> > Plot(BBBottom ,"BBBottom ",2,1);
> > Plotcolor = IIf(C-O>0,5,4);
> > minimum = LastValue( Lowest( Volume ) );
> > maximum = LastValue( Highest( Volume ) );
> > Plot( MA(V,1),"Volume = ", Plotcolor ,
> > styleHistogram|styleNoLabel|styleOwnScale,Minimum,4*Maximum);
> > Title = EncodeColor(7) +  "Acceleration Bands-Price Headley; 
Period =
> > 20;" +
> > EncodeColor(6) + "\nAcceleration Bands; ConstBandwidth Ratio = "  
+
> > WriteVal(COnstBWR ,2.0) + "; PeriodMA-Price Headley = " +
> > WriteVal(PerMAPH,2.0) + ";"  +
> > EncodeColor(1)+"\nMA Bands; CenterBand MA Offset; Offset Perc = " 
+
> > WriteVal(OffsetPerc,2.0) + "; PeriodMA = " + WriteVal(PeriodMA ,2.
0)
> > +";" +
> > EncodeColor(2)+ " \nBollinger Bands - StdDev = " + 
WriteVal(BBStdDev,
> > 2.0) + "; BBPeriod = " + WriteVal(BBPeriod ,2.0) +";" ;
> >
> >
> >
> >
> >
> >
> > 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 --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/