# Custom Formula Collection

Here are custom ADX and ADXR formulas that will plot the decimals after the calculation. The built-in indicators plot exactly as Welles Wilder plots them in his book, New Concepts in Technical Trading Systems. These custom indicators calculate the same way except they do not round as Wilder does.

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;

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;