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

Re: [amibroker] Help with "Foreign" and "ADX()"......



PureBytes Links

Trading Reference Links

Keith,

Here are two formulas: ADXR Custom and ADX custom, Is this what you
seek.

/* ADXR 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);
ADXRCUSTOM= (ADXFinal+Ref(ADXFinal,LastValue(1-periods)))/2;
Graph0=ADXRCustom;

/************************************************************/

/* 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;
Title=Name()+" ADXR RATING: "+"("
+WriteVal(ADXRCUSTOM,FORMAT=1.2)+")"+" :::" +" ADX VALUE
"+"("+WriteVal(ADXFINAL,FORMAT=1.2)+") ";
/******************************************************/

Anthony

Keith Bennett wrote:

>
> Is there any way to use the FOREIGN function with ADX and DI?
> Alternatively, are the ADX and DI formulas available anywhere? At the
> moment I note the trade dates using the ADX()/^NDX, and then use:
>
> Buy if Month()== and Day()== and Year()==.
>
> It works but it's tedious.
>
> Keith (B)
>
>
> Yahoo! Groups Sponsor
ADVERTISEMENT


>
> 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.