| 
 Thanks Anthony for posting this again for all to see. 
I've 
used it as an indicator for quite a while now.  Also, 
this indicator  
module has a lot of features, 
where each feature could be a snippet. 
  
How to Shade 
How to plot a trendline from code  
How to detect a breakout based on these 
trendlines 
How to plot support and resistance  
etc. 
IMHO..Each one a key concept not readily evident 
from 
the on line documentation and should be in 
ABWiki.. 
  
Best regards 
JOE  
  
  ----- Original Message -----  
  
  
  Sent: Monday, July 04, 2005 3:06 PM 
  Subject: Re: [amibroker] Re: Colored 
  Regions in Amibroker Charts... 
  
  
  Here is something I posted long ago.. 
    
  
  //Pattern Recognition graph 
  //with shading 
    
    
    
  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);
  >IIf(fill== 1,styleHistogram|styleThick,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 -----  
    
    
    Sent: Monday, July 04, 2005 8:52 
    AM 
    Subject: [amibroker] Re: Colored 
    Regions in Amibroker Charts... 
    
  Can anyone tell me how you can color regions in an 
    Amibroker chart  like the charts listed at
  http://www.tradingbasis.com/en/pivot.htm
  and
  http://www.tradingbasis.com/en/tp.htm
  Thanks, Nurudin
 
  --- 
    In amibroker@xxxxxxxxxxxxxxx, 
    "Nurudin Kaba" <n.kaba@x...> 
    wrote: > can someone tell me how you can color regions in an Amibroker 
     chart like the > charts listed at >  > http://www.tradingbasis.com/en/pivot.htm > 
    and > http://www.tradingbasis.com/en/tp.htm > 
     > Thanks >   -----Original 
    Message----- >   From: amibroker@xxxxxxxxxxxxxxx 
     [mailto:amibroker@xxxxxxxxxxxxxxx]On > Behalf Of 
    TB >   Sent: Sunday, July 03, 2005 07:39 >   
    To: amibroker@xxxxxxxxxxxxxxx >   Subject: [amibroker] yahoo 
    database with 9000 stocks >  >  >   
    Hello, >  >  >  >   I remember there is 
    anywhere a file with a complete yahoo  database, also > based on 
    sectors and industries. >  >   Does someone know where 
    I can download it ? >  >  >  >   
    Regards >  >  >  >   Thomas > 
     >   www.tradingbasis.com >  >  >  > 
     >  >   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 other support material please 
    check also: >   http://www.amibroker.com/support.html > 
     >  >  >  >  > 
    ------------------------------------------------------------------- --------- > 
    -- >   YAHOO! GROUPS LINKS > 
     >     a..  Visit your group "amibroker" on 
    the web. >  >     b..  To unsubscribe 
    from this group, send an email to: >      
    amibroker-unsubscribe@xxxxxxxxxxxxxxx > 
     >     c..  Your use of Yahoo! Groups is 
    subject to the Yahoo! Terms  of > Service. >  > 
     > 
    ------------------------------------------------------------------- --------- > 
    --
 
 
 
  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 other support 
    material please check also: http://www.amibroker.com/support.html
 
 
  ---- LSpots keywords ?>---- HM ADS ?>
    
      
    No virus found in this incoming message. Checked by AVG 
    Anti-Virus. Version: 7.0.323 / Virus Database: 267.8.8/35 - Release Date: 
    6/30/2005
  
  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 other 
  support material please check also: http://www.amibroker.com/support.html
 
 
  ---- LSpots keywords ?>---- HM ADS ?>
  
    
  No virus found in this outgoing message. Checked by AVG 
  Anti-Virus. Version: 7.0.323 / Virus Database: 267.8.8/35 - Release Date: 
  6/30/2005
  
  
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 other support material please check also: 
http://www.amibroker.com/support.html 
 
  
---- LSpots keywords ?>
  
  
  
    SPONSORED LINKS
   
       
 
  
    
  YAHOO! GROUPS LINKS
 
 
    
 |