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

Re: [amibroker] Re: Dimensionally Coherent Relative Strength (Mark )



PureBytes Links

Trading Reference Links




Mark,
 
Does this do it:
 

//Normalize the Open,High,Low,Close<FONT face="Courier New" 
size=2>
priceopen = Open;
normalOpen=<FONT face="Courier New" color=#ff00ff 
size=2>100*(priceopen-<FONT 
face="Courier New" color=#0000ff size=2>Lowest<FONT face="Courier New" 
size=2>(priceopen))/(<FONT face="Courier New" color=#0000ff 
size=2>Highest(priceopen)-<FONT 
face="Courier New" color=#0000ff size=2>Lowest<FONT face="Courier New" 
size=2>(priceopen)); 
priceclose=Close;
normalclose=<FONT face="Courier New" color=#ff00ff 
size=2>100*(priceclose-<FONT 
face="Courier New" color=#0000ff size=2>Lowest<FONT face="Courier New" 
size=2>(priceclose))/(<FONT face="Courier New" color=#0000ff 
size=2>Highest(priceclose)-<FONT 
face="Courier New" color=#0000ff size=2>Lowest<FONT face="Courier New" 
size=2>(priceclose)); 
pricehigh=High;
normalhigh=<FONT face="Courier New" color=#ff00ff 
size=2>100*(pricehigh-<FONT 
face="Courier New" color=#0000ff size=2>Lowest<FONT face="Courier New" 
size=2>(pricehigh))/(<FONT face="Courier New" color=#0000ff 
size=2>Highest(pricehigh)-<FONT 
face="Courier New" color=#0000ff size=2>Lowest<FONT face="Courier New" 
size=2>(pricehigh));
pricelow=Low;
normallow=<FONT face="Courier New" color=#ff00ff 
size=2>100*(pricelow-<FONT 
face="Courier New" color=#0000ff size=2>Lowest<FONT face="Courier New" 
size=2>(pricelow))/(<FONT face="Courier New" color=#0000ff 
size=2>Highest(pricelow)-<FONT 
face="Courier New" color=#0000ff size=2>Lowest<FONT face="Courier New" 
size=2>(pricelow));
PlotOHLC<FONT face="Courier New" 
size=2>(normalopen,normalhigh,normallow,normalclose,<FONT 
face="Courier New" color=#ff00ff size=2>""<FONT face="Courier New" 
size=2>,colorBlack,styleCandle);<FONT face="Courier New" 
color=#ff0000 size=2>
//----------------------------//<FONT face="Courier New" 
size=2>
//Automatic Support Trendline With Degrees
//Anthony Faragasso, 2003
x = Cum<FONT 
face="Courier New" size=2>(<FONT face="Courier New" color=#ff00ff 
size=2>1);
per =Param<FONT 
face="Courier New" size=2>(<FONT face="Courier New" color=#ff00ff 
size=2>"Percent",<FONT 
face="Courier New" color=#ff00ff size=2>2<FONT face="Courier New" 
size=2>,<FONT face="Courier New" color=#ff00ff 
size=2>0.01,<FONT 
face="Courier New" color=#ff00ff size=2>5<FONT face="Courier New" 
size=2>,<FONT face="Courier New" color=#ff00ff 
size=2>0.01);<FONT 
face="Courier New" color=#ff0000 size=2>// Sensitivity setting<FONT 
face="Courier New" size=2>
s1=normalLow;<FONT face="Courier New" color=#ff0000 
size=2>//Array
EndValue1 = <FONT face="Courier New" color=#0000ff 
size=2>LastValue( <FONT 
face="Courier New" color=#0000ff size=2>Trough<FONT face="Courier New" 
size=2>( s1, per, <FONT face="Courier New" color=#ff00ff 
size=2>1 ) );
startvalue = <FONT face="Courier New" color=#0000ff 
size=2>LastValue( <FONT 
face="Courier New" color=#0000ff size=2>Trough<FONT face="Courier New" 
size=2>( s1, per, <FONT face="Courier New" color=#ff00ff 
size=2>2 ) );
endbar = <FONT face="Courier New" color=#0000ff 
size=2>LastValue( <FONT 
face="Courier New" color=#0000ff size=2>ValueWhen<FONT face="Courier New" 
size=2>( s1 == EndValue1, x, <FONT face="Courier New" color=#ff00ff 
size=2>1 ) );
startbar = <FONT face="Courier New" color=#0000ff 
size=2>LastValue( <FONT 
face="Courier New" color=#0000ff size=2>ValueWhen<FONT face="Courier New" 
size=2>( s1 == startvalue, x, <FONT face="Courier New" color=#ff00ff 
size=2>1 ) );
aS = (EndValue1-startvalue)/(endbar-startbar);
bS = EndValue1;
trendline = aS * ( x -endbar ) + bS; <FONT face="Courier New" 
color=#ff0000 size=2>
//-----------------------------------//
// Conversion <FONT face="Times New Roman" color=#ff0000 
size=2>Radians to Degrees 
//
//-----------------------------------//<FONT face="Courier New" 
size=2>
pi=4<FONT 
face="Courier New" size=2>*<FONT face="Courier New" color=#0000ff 
size=2>atan(<FONT 
face="Courier New" color=#ff00ff size=2>1<FONT face="Courier New" 
size=2>);
time=endbar-startbar;
myslope=<FONT face="Courier New" color=#0000ff 
size=2>LinRegSlope(trendline,time);
myradian=<FONT face="Courier New" color=#0000ff 
size=2>atan(myslope);
mydegree=myradian*(<FONT face="Courier New" color=#ff00ff 
size=2>180/PI);<FONT 
face="Courier New" color=#ff0000 size=2>//Degrees
//-------------------------------------//<FONT face="Courier New" 
size=2>
//Plot(C,"close",colorBlack,styleCandle);<FONT face="Courier New" 
color=#0000ff size=2>
Plot(<FONT face="Courier New" 
color=#0000ff size=2>IIf<FONT face="Courier New" 
size=2>(x>startbar-<FONT face="Courier New" color=#ff00ff 
size=2>5,trendline,-<FONT 
face="Courier New" color=#ff00ff size=2>1e10<FONT face="Courier New" 
size=2>),<FONT face="Courier New" color=#ff00ff 
size=2>"Trendline"<FONT face="Courier New" 
size=2>,colorYellow,styleLine);
direction=<FONT face="Courier New" color=#0000ff 
size=2>WriteIf(mydegree >= 
0<FONT 
face="Courier New" size=2> AND mydegree <= <FONT 
face="Courier New" color=#ff00ff size=2>0.99<FONT face="Courier New" 
size=2>,"Flat 
",<FONT face="Courier New" 
color=#0000ff size=2>WriteIf(mydegree 
> 0<FONT 
face="Courier New" size=2> ,<FONT face="Courier New" color=#ff00ff 
size=2>"Rising ",<FONT 
face="Courier New" color=#0000ff size=2>WriteIf<FONT face="Courier New" 
size=2>(mydegree < <FONT face="Courier New" color=#ff00ff 
size=2>0 , <FONT 
face="Courier New" color=#ff00ff size=2>"Falling "<FONT 
face="Courier New" size=2>, <FONT face="Courier New" color=#ff00ff 
size=2>"")));
DirectionColor=<FONT face="Courier New" color=#0000ff 
size=2>LastValue(<FONT 
face="Courier New" color=#0000ff size=2>IIf<FONT face="Courier New" 
size=2>(mydegree > <FONT face="Courier New" color=#ff00ff 
size=2>0,colorBrightGreen,<FONT 
face="Courier New" color=#0000ff size=2>IIf<FONT face="Courier New" 
size=2>(mydegree < <FONT face="Courier New" color=#ff00ff 
size=2>0, colorRed,<FONT 
face="Courier New" color=#0000ff size=2>IIf<FONT face="Courier New" 
size=2>(mydegree >= <FONT face="Courier New" color=#ff00ff 
size=2>0 AND mydegree <= 
0.99<FONT 
face="Courier New" size=2> ,colorYellow,Null))));
Title=Name<FONT 
face="Courier New" size=2>()+<FONT face="Courier New" color=#ff00ff 
size=2>"..."+<FONT 
face="Courier New" color=#0000ff size=2>Date<FONT face="Courier New" 
size=2>()+<FONT face="Courier New" color=#ff00ff 
size=2>"\n"+<FONT 
face="Courier New" color=#ff00ff size=2>"TRENDLINE is "<FONT 
face="Courier New" size=2>+<FONT face="Courier New" color=#0000ff 
size=2>EncodeColor<FONT face="Courier New" 
size=2>(directioncolor)+direction+<FONT face="Courier New" color=#0000ff 
size=2>EncodeColor<FONT face="Courier New" 
size=2>(colorBlack)+"at 
"+<FONT face="Courier New" 
color=#ff00ff size=2>"( "+ 
WriteVal<FONT 
face="Courier New" size=2>(mydegree,<FONT face="Courier New" 
color=#ff00ff size=2>1<FONT face="Courier New" 
size=2>)+" 
)"+<FONT face="Courier New" 
color=#ff00ff size=2>" Degrees"<FONT face="Courier New" 
size=2>+<FONT face="Courier New" color=#ff00ff 
size=2>"\n"+time+<FONT 
face="Courier New" color=#ff00ff size=2>" days"<FONT 
face="Courier New" size=2>+<FONT face="Courier New" color=#ff00ff 
size=2>"\n"+<FONT 
face="Courier New" color=#ff00ff size=2>"Slope = "<FONT 
face="Courier New" size=2>+<FONT face="Courier New" color=#0000ff 
size=2>WriteVal(myslope,<FONT 
face="Courier New" color=#ff00ff size=2>1.2<FONT face="Courier New" 
size=2>)+<FONT face="Courier New" color=#ff00ff 
size=2>"\n"+<FONT 
face="Courier New" color=#ff00ff size=2>"Radians = "<FONT 
face="Courier New" size=2>+<FONT face="Courier New" color=#0000ff 
size=2>WriteVal(myradian,<FONT 
face="Courier New" color=#ff00ff size=2>1.2<FONT face="Courier New" 
size=2>)+<FONT face="Courier New" color=#ff00ff 
size=2>"\n";
 
//plotting ( x, y ) grid<FONT face="Courier New" color=#0000ff 
size=2>
Plot(startbar==x,<FONT 
face="Courier New" color=#ff00ff size=2>""<FONT face="Courier New" 
size=2>,colorRed,styleHistogram|styleOwnScale);<FONT 
face="Courier New" color=#0000ff size=2>
Plot(<FONT face="Courier New" 
color=#0000ff size=2>ValueWhen<FONT face="Courier New" 
size=2>(startbar==x,normalLow),<FONT face="Courier New" color=#ff00ff 
size=2>""<FONT face="Courier New" 
size=2>,colorRed,styleLine);<FONT face="Courier New" color=#ff0000 
size=2>
//-----------------------------------//
// Automatic Anlaysis window Output //
//-----------------------------------//
// Settings : //
// n last quotations and n=1 //
// explore //
//-----------------------------------//<FONT face="Courier New" 
size=2>
Filter=mydegree > <FONT face="Courier New" color=#ff00ff 
size=2>0 OR mydegree 
<0<FONT 
face="Courier New" size=2>;<FONT face="Courier New" color=#0000ff 
size=2>
AddColumn(mydegree,<FONT 
face="Courier New" color=#ff00ff size=2>"Degree"<FONT 
face="Courier New" size=2>,<FONT face="Courier New" color=#ff00ff 
size=2>1);


 
---Outgoing mail is certified Virus Free.Checked 
by AVG anti-virus system (<A 
href="">http://www.grisoft.com).Version: 6.0.491 / 
Virus Database: 290 - Release Date: 
6/18/2003






Yahoo! Groups Sponsor












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 the Yahoo! Terms of Service.