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

[amibroker] Re: Enhanced H&S pattern, I [the false readings] -- For DT



PureBytes Links

Trading Reference Links

Thanks, Anthony!

Mark

--- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxxx>
wrote:
> Mark,
> 
> Here is a formula I have been using....You can use the same formula in
> Indicator builder and Automatic Analysis.
> 
> // Patterns
> 
> x = Cum(1);
> 
> per = Param("Percent",3,1,5,1);
> 
> s1=L;
> 
> s11=H;
> 
> pS = TroughBars( s1, per, 1 ) == 0;
> 
> endt= LastValue(ValueWhen( pS, x, 1 ));
> 
> startt=LastValue(ValueWhen( pS, x, 2 ));
> 
> endS = LastValue(ValueWhen( pS, s1, 1 ) );
> 
> startS = LastValue( ValueWhen( pS, s1, 2 ));
> 
> dtS =endt-startt;
> 
> aS = (endS-startS)/dtS;
> 
> bS = endS;
> 
> trendlineS = aS * ( x -endt ) + bS;
> 
> 
> 
> pR = PeakBars( s11, per, 1 ) == 0;
> 
> endt1= LastValue(ValueWhen( pR, x, 1 ));
> 
> startt1=LastValue(ValueWhen( pR, x, 2 ));
> 
> endR = LastValue(ValueWhen( pR, s11, 1 ) );
> 
> startR = LastValue( ValueWhen( pR, s11, 2 ));
> 
> DTR=ENDT1-STARTT1;
> 
> aR = (endR-startR)/dtR;
> 
> bR = endR;
> 
> trendlineR = aR * ( x -endt1 ) + bR;
> 
> BEGIN=Min(STARTT,STARTT1);
> 
> TRS = IIf(x>BEGIN-10,trendlineS,-1e10);
> 
> TRR = IIf(x>BEGIN-10,trendlineR,-1e10);
> 
> 
> 
> Condcolor=(Cross(C,trendlineR) AND X>ENDT1) OR (Cross(trendlineS,C) AND
> 
> X>ENDT);
> 
> BarColor=IIf(Condcolor,7,1);
> 
> Plot(C,"Close",BarColor,styleCandle);
> 
> Plot(TRS,"Support",colorYellow,styleLine);
> 
> Plot(TRR,"Resist",colorYellow,styleLine);
> 
> /////////////////////////////////////
> 
> // Shading //
> 
> ////////////////////////////////////
> 
> fill=Param("style",2,1,2,1);
> 
> style=IIf(fill==1,styleHistogram,IIf(fill==2,styleArea,Null));
> 
> x=IIf(trs > trr,trr,trs);
> 
> Plot(x,"",colorLightGrey,style);
> 
> Plot(trr,"",colorPink,style);
> 
> ////////////////////////////////////////////
> 
> // Pattern Recognition in title bar //
> 
> ///////////////////////////////////////////
> 
> 
> Lowline=Ends-starts;
> 
> Highline=endr-startr;
> 
> Wedge=IIf(Highline <0 AND Lowline > 0,1,0);
> 
> DecendingTriangle=IIf(Highline < 0 AND Lowline==0,1,0);
> 
> AscendingTriangle=IIf(Highline==0 AND Lowline > 0,1,0);
> 
> DownChannel=IIf(Highline<0 AND Lowline<0,1,0);
> 
> UpChannel=IIf(Highline>0 AND Lowline>0,1,0);
> 
> BroadeningWedge=IIf(Highline > 0 AND Lowline < 0,1,0);
> 
> ///////////////////////////////////
> 
> // Bullish or Bearish breakout //
> 
> //////////////////////////////////
> 
> BullishBreakout=Cross(C,trendlineR);
> 
> BearishBreakout=Cross(trendlineS,C);
> 
> 
> 
> Title=Name()+ WriteIf(wedge==1,"
Wedge","")+WriteIf(DecendingTriangle==1,"
> Decending Triangle","")+WriteIf(AscendingTriangle==1,"Ascending
> Triangle","")/*+WriteVal(Lowline)*/+WriteIf(DownChannel==1," Downward
> Sloping Channel","")+WriteIf(UpChannel==1," Upward Sloping
> Channel","")+WriteIf(broadeningWedge==1," Broadening
> Wedge","")+"\n"+EncodeColor(colorGreen)+WriteIf(bullishbreakout,"Bullish
> Breakout",EncodeColor(colorRed)+WriteIf(bearishbreakout,"Bearish
> Breakout",""))/*+WriteVal(highline)*/;
> 
> /////////////////////////////////////
> 
> // Automatic Analysis //
> 
> ////////////////////////////////////
> 
> Filter=AscendingTriangle OR DecendingTriangle OR Wedge OR DownChannel OR
> UpChannel OR BroadeningWedge OR Bullishbreakout OR bearishbreakout;
> 
> AddTextColumn(WriteIf(bullishbreakout,"bullish
Breakout",""),"BullBreak");
> 
> AddTextColumn(WriteIf(bearishBreakout,"Bearish
Breakout",""),"BearBreak");
> 
> AddTextColumn(WriteIf(ascendingtriangle,"Ascending
> Triangle",WriteIf(decendingtriangle,"Decending
> Triangle",WriteIf(Wedge,"Wedge",WriteIf(DownChannel,"Down
> Channel",WriteIf(UpChannel,"Up
Channel",WriteIf(BroadeningWedge,"Broadening
> Wedge","")))))),"Pattern");
> 
> ----- Original Message ----- 
> From: "quanttrader714" <quanttrader714@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Thursday, November 20, 2003 1:45 PM
> Subject: [amibroker] Re: Enhanced H&S pattern, I [the false
readings] -- For
> DT
> 
> 
> Hi DT,
> 
> One pattern I trade (when I notice it) is the ascending triangle.  I
> have your pattern recognition exploration which includes it, but never
> seem to be able to find any.  Would love to be able to scan for
> candidates to review.  Any ideas on how to make the code more
> "liberal" or just some simple code for only the ascending triangle
> that I could play with and adjust?  I looked at what you coded in the
> exploration and must admit I don't follow it.  Thanks!
> 
> Mark
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
> wrote:
> > --- In amibroker@xxxxxxxxxxxxxxx, Yuki Taga <yukitaga@xxxx> wrote:
> > > Hi DT,
> > >
> > > Thursday, November 20, 2003, 7:58:12 PM, you wrote:
> > >
> > > >> 2) The right shoulder is slightly higher than the left
> shoulder.
> > > >> That's a no-no for me.  It should be no higher than, and
> ideally
> > > DT> just
> > > >> a touch lower than, the left shoulder. (Yes, I'm picky.)  ^^_^^
> > >
> > > DT> But you speak for a 37.36 vs 37.75, ie an 1% difference ????
> > >
> > > I can't help it.  ^_^  I noticed it right away.
> > >
> > > >> 3) A touch of the neckline is a touch of a *support* line.
> > While a
> > > >> H&S is generally a bearish formation, it is not really bearish
> > until
> > > >> you get a clean, confirmed break of that neckline.  This one
> has
> > no
> > > >> clean break.  I would say a clean break is at least one bar
> with
> > the
> > > >> high lower than the neckline.  Until that happens, it's a
> support
> > > >> line, even in a rather bearish formation.  Penetration is NOT
> > > >> guaranteed by the formation itself.  Maybe people
> misunderstand
> > > DT> this,
> > > >> and that's why so many claim the formation is worthless.  Any
> > > >> formation is worthless if you don't play by the rules.  ^_-
> > >
> > > DT> But, you shorted ^N225 3 bars b e f o r e the [unknown for
> this
> > > DT> moment neckline breakout], donīt you remember ??
> > >
> > > Sure I remember.  ^_^  But I was not playing for a neckline
> > breakout.
> > > I was playing for a fall to the neckline.  I got it.  It was a
> > normal
> > > swing type play I think.  I saw the bounce rolling over, and I
> took
> > > the short.
> > >
> > > At the time I took the shorts, and even before, I had a vision of
> a
> > > H&S setting up.  But to be sure, I didn't take those shorts
> > *because*
> > > of any H&S.  I took them because price was rolling over, and the
> > > overall formation spoke of price weariness.
> > >
> > > DT> The question that began this thread is what do we do 2-3 bars
> b
> > e f o
> > > DT> r e the neckline touch.
> > >
> > > If you see it setting up, why would you not short the right
> > > shoulder's rollover?  The obvious answer is, "How much room do you
> > > have before you hit support"?  I had plenty of room, and one
> reason
> > I
> > > had that room was that the neckline was horizontal.
> > >
> > > Now look at BA again.  Short the breakdown on 10/21, and you have
> a
> > > profitable swing.  It's not much though, because the neckline is
> > > rising left to right.  So you get a bar or two, and you better be
> > > nimble about getting out.
> > >
> > > DT> IMO, BA is a typical whipsaw example.
> > >
> > > IMO, BA is not an example to get very excited about.  As I say, I
> > > didn't even see it until your code forced me to.
> > >
> > > DT> This would be a good end of this thread: A H&S is what we see
> > as a
> > > DT> H&S and nothing more. I tried [unsucessfully] to introduce
> some
> > > DT> objective criteria following your [respectable] personal
> > vision, but
> > > DT> it is the moment I give up.
> > >
> > > It's okay DT.  Really.  I think it is probably Mission Impossible
> > > anyway.
> > >
> > > >> (One of the great keys to successful swing trading --
> especially
> > > >> short trading -- is figuring out how many got in how much
> trouble
> > > >> exactly where.  This is what made the ^225 H&S "predictable"
> > before
> > > >> it fully formed, IMO.)
> > >
> > > DT> Shall we add this "how many got in how much trouble exactly
> > where" in
> > > DT> H&S criteria ? You should be kidding...
> > >
> > > No, no, no.  ^_^  Just a general comment on trading, that's all.
> It
> > > was clear some people were in trouble here in Tokyo, and if it was
> > > clear to this girl, it was also clear to people with a lot more
> > money
> > > who can really make things happen.  I think they did.
> > >
> > > DT> Thank you for your opinions, I give up at this critical point.
> > > DT> Dimitris Tsokakis
> > >
> > > Thanks for your hard work DT.  I hope you are not angry at me.  I
> do
> > > appreciate all (and I marvel at your coding ability), but I do
> think
> > > this type of thing has to be so obvious we don't need to code it.
> 
> > As
> > > I said, it's kind of an analog thing (Left brain?  Right brain?  I
> > > can never remember which one I'm using, or supposed to be using).
> > > ^^_^^
> > >
> > > Best,
> > >
> > > Yuki
> >
> > King Gelon said to Archimedes : Even if you calculate the number of
> > the sans grains to fill the whole universe, it will be impossible
> to
> > say it, we do not have such great numbers in our [math or not]
> > language.
> > Archimedes did the calculation first and then [that simple for him]
> > created out of the blue a new counting system to express his own
> > solution.
> > [http://physics.weber.edu/carroll/Archimedes/sand.htm
> > http://www.etext.org/Zines/Critique/article/reckoner.html
> > etc etc]
> > It was probably one of the first "never say never" . Myriads
> > followed...
> > Dimitris Tsokakis
> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> 
> 
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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