PureBytes Links
Trading Reference Links
|
I like your automatic trendlines but think there are inherent problems
with angles and slopes, even with logarithmic scales and
transformations. The recommendation I posted in this message captures
a coherent measurement from the trendlines that can be used for
comparison.
http://groups.yahoo.com/group/amibroker/message/42966
Mark
--- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxxx>
wrote:
> Thanks for the feedback....Do you have any ideas....code...etc..
>
> Anthony
> ----- Original Message -----
> From: MarkF2
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Tuesday, June 24, 2003 1:56 PM
> Subject: [amibroker] Re: Dimensionally Coherent Relative Strength
(Anthony )
>
>
> Anthony,
>
> No, it doesn't, because the angles still depend on the unit of
measure
> for price, although they seem not to because you've developed a
clever
> workaround.
>
> I changed "100" to "200" in your formulas for normalopen,
normalclose,
> normalhigh, and pricelow. This changed the price levels twofold
and
> also the angle measurements. That's critical for 2 reasons:
>
> First, the normalized price levels (and therefore angle
measurements)
> depend on how much data is in the user's database because that
> determines the price range used for normalization. So someone
> applying the indicator with only 2 years of price data will get a
> different number of degrees for the same pattern than someone
with 3
> or 15 years.
>
> Second, the normalized price levels (and therefore angle
measurements)
> also depend on where a stock is trading now relative to the range
of
> that stock in the database. So the same pattern would yield
different
> angle readings if the stock is trading low in its range as
opposed to
> high, for instance.
>
>
> Mark
>
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso"
<ajf1111@xxxx>
> wrote:
> > Mark,
> >
> > Does this do it:
> >
> > //Normalize the Open,High,Low,Close
> >
> > priceopen = Open;
> >
> >
> normalOpen=100*(priceopen-Lowest(priceopen))/(High
> est(priceopen)-Lowest(priceopen));
>
> >
> > priceclose=Close;
> >
> >
> normalclose=100*(priceclose-Lowest(priceclose))/(H
> ighest(priceclose)-Lowest(priceclose));
>
> >
> > pricehigh=High;
> >
> >
> normalhigh=100*(pricehigh-Lowest(pricehigh))/(High
> est(pricehigh)-Lowest(pricehigh));
> >
> > pricelow=Low;
> >
> >
> normallow=100*(pricelow-Lowest(pricelow))/(Highest
> (pricelow)-Lowest(pricelow));
> >
> >
> PlotOHLC(normalopen,normalhigh,normallow,normalclo
> se,"",colorBlack,styleCandle);
> >
> > //----------------------------//
> >
> > //Automatic Support Trendline With Degrees
> >
> > //Anthony Faragasso, 2003
> >
> > x = Cum(1);
> >
> > per =Param("Percent",2,0.01,5,0.01);// Sensitivity setting
> >
> > s1=normalLow;//Array
> >
> > EndValue1 = LastValue( Trough( s1, per, 1 ) );
> >
> > startvalue = LastValue( Trough( s1, per, 2 ) );
> >
> > endbar = LastValue( ValueWhen( s1 == EndValue1, x, 1 ) );
> >
> > startbar = LastValue( ValueWhen( s1 == startvalue, x, 1 ) );
> >
> > aS = (EndValue1-startvalue)/(endbar-startbar);
> >
> > bS = EndValue1;
> >
> > trendline = aS * ( x -endbar ) + bS;
> >
> > //-----------------------------------//
> >
> > // Conversion Radians to Degrees //
> >
> > //-----------------------------------//
> >
> > pi=4*atan(1);
> >
> > time=endbar-startbar;
> >
> > myslope=LinRegSlope(trendline,time);
> >
> > myradian=atan(myslope);
> >
> > mydegree=myradian*(180/PI);//Degrees
> >
> > //-------------------------------------//
> >
> > //Plot(C,"close",colorBlack,styleCandle);
> >
> >
> Plot(IIf(x>startbar-5,trendline,-1e10),"Trendline"
> ,colorYellow,styleLine);
> >
> > direction=WriteIf(mydegree >= 0 AND mydegree <= 0.99,"Flat
> ",WriteIf(mydegree > 0 ,"Rising ",WriteIf(mydegree < 0 , "Falling
",
> "")));
> >
> > DirectionColor=LastValue(IIf(mydegree >
> 0,colorBrightGreen,IIf(mydegree < 0, colorRed,IIf(mydegree >= 0
AND
> mydegree <= 0.99 ,colorYellow,Null))));
> >
> > Title=Name()+"..."+Date()+"\n"+"TRENDLINE is
> "+EncodeColor(directioncolor)+direction+Encode
Color(colorBlack)+"at
> "+"( "+ WriteVal(mydegree,1)+" )"+" Degrees"+"\n"+time+"
> days"+"\n"+"Slope = "+WriteVal(myslope,1.2)+"\n"+"Radians =
> "+WriteVal(myradian,1.2)+"\n";
> >
> >
> >
> > //plotting ( x, y ) grid
> >
> > Plot(startbar==x,"",colorRed,styleHistogram|styleOwnScale);
> >
> > Plot(ValueWhen(startbar==x,normalLow),"",colorRed,styleLine);
> >
> > //-----------------------------------//
> >
> > // Automatic Anlaysis window Output //
> >
> > //-----------------------------------//
> >
> > // Settings : //
> >
> > // n last quotations and n=1 //
> >
> > // explore //
> >
> > //-----------------------------------//
> >
> > Filter=mydegree > 0 OR mydegree <0;
> >
> > AddColumn(mydegree,"Degree",1);
> >
> >
> >
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
>
>
>
>
>
> 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 the Yahoo! Terms of
Service.
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/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/
|