PureBytes Links
Trading Reference Links
|
/* ADX CUSTOM*/
Periods=14;
PlusDM=IIf(H>Ref(H,-1) AND L>=Ref(L,-1), H-Ref(H,-1),IIf(H >Ref(H,-1)
AND L<Ref(L,-1)
AND H-Ref(H,-1)> Ref(L,-1)-L,
H-Ref(H,-1),0));
PlusDI=100*Wilders(PlusDM,Periods)/ATR(Periods);
MinusDM=IIf(L<Ref(L,-1) AND H<=Ref(H,-1), Ref(L,-1)-L,IIf(H>Ref(H,-1)
AND L<Ref(L,-1)
AND H-Ref(H,-1)<Ref(L,-1)-L,
Ref(L,-1)-L,0));
MinusDI=100*Wilders(MinusDM,Periods)/ATR(Periods) ;
DIDif=abs(PlusDI-MinusDI);
DISum=PlusDI+MinusDI;
ADXFinal=100*Wilders(DIDif/DISum,Periods);
Graph1=ADXFinal;
/* ADX CUSTOM*/
Periods=14;
PlusDM=IIf(H>Ref(H,-1) AND L>=Ref(L,-1), H-Ref(H,-1),IIf(H >Ref(H,-1)
AND L<Ref(L,-1)
AND H-Ref(H,-1)> Ref(L,-1)-L,
H-Ref(H,-1),0));
PlusDI=100*Wilders(PlusDM,Periods)/ATR(Periods);
MinusDM=IIf(L<Ref(L,-1) AND H<=Ref(H,-1), Ref(L,-1)-L,IIf(H>Ref(H,-1)
AND L<Ref(L,-1)
AND H-Ref(H,-1)<Ref(L,-1)-L,
Ref(L,-1)-L,0));
MinusDI=100*Wilders(MinusDM,Periods)/ATR(Periods) ;
DIDif=abs(PlusDI-MinusDI);
DISum=PlusDI+MinusDI;
ADXFinal=100*Wilders(DIDif/DISum,Periods);
Plot(ADXFinal,"adxCustom",colorRed,styleLine);
Rick Parsons wrote:
> Thanks, Jason ! I'll give it a try. Rick
>
> -----Original Message-----
> From: Jayson [mailto:jcasavant@xxxxxxxxxxxx]
> Sent: Wednesday, February 26, 2003 9:55 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: RE: [amibroker] ADX
>
> Rick,here is a formula for ADX. Since the indicator looks at
> high and low values of the security you could rename the
> Highs and Lows with a custom "Line" I do not know what you
> are trying to accomplish but something along the lines
> of.....h=ma(h,50); l=ma(l,50);Since the built in indicator
> is probably using the built in PDI and MDI for the math you
> would probably need to convert the code below to AB then
> plot "ADXFinal"
> ADX Custom
>
> Periods:=Input("Time Periods",1,100,14);
> PlusDM:=If(H>Ref(H,-1) AND L>=Ref(L,-1), H-Ref(H,-1),If(H
> >Ref(H,-1) AND L<Ref(L,-1)
> AND H-Ref(H,-1)> Ref(L,-1)-L, H-Ref(H,-1),0));
> PlusDI:=100*Wilders(PlusDM,Periods)/ATR(Periods);
> MinusDM:=If(L<Ref(L,-1) AND H<=Ref(H,-1),
> Ref(L,-1)-L,If(H>Ref(H,-1) AND L<Ref(L,-1)
> AND H-Ref(H,-1)<Ref(L,-1)-L, Ref(L,-1)-L,0));
> MinusDI:=100*Wilders(MinusDM,Periods)/ATR(Periods);
> DIDif:=Abs(PlusDI-MinusDI);
> DISum:=PlusDI+MinusDI;
> ADXFinal:=100*Wilders(DIDif/DISum,Periods);
> ADXFinalJayson
> -----Original Message-----
> From: Rick Parsons [mailto:RickParsons@xxxxxxxxxxxxxxx]
> Sent: Wednesday, February 26, 2003 8:14 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] ADX
>
> If I code : Line = MySpecialFormula Etc; How does one
> calculate an ADX(14) on "Line"?? There is no "Array" parm.
>
> Thanks,
> Rick
>
> 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.
>
>
> 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.
>
>
> Yahoo! Groups Sponsor
ADVERTISEMENT
>
> 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.
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/
|