Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi BH I'm not surprised that you didn't get any output from your attempt - that's because you forgot to follow my instructions and replace the unwanted ADX output code line with DIPlus or DIMinus. The BOLD text at the end of each formula is what makes the output or result of an MS formula available to the outside world. This output can be either the name of an already defined variable, as is the case of the first two formulas below, or it can be an unnamed variable as seen in the second two formulas. {Directional movement +DI} Periods:=Input("Enter 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));DIPlus:=100*Wilders(PlusDM,Periods)/ATR(Periods);DIPlus;
{Directional movement -DI} Periods:=Input("Enter time periods",1,100,14); 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));DIMinus:=100*Wilders(MinusDM,Periods)/ATR(Periods); DIMinus;
{Directional movement +DI} Periods:=Input("Enter 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));100*Wilders(PlusDM,Periods)/ATR(Periods);
{Directional movement -DI} Periods:=Input("Enter time periods",1,100,14); 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));100*Wilders(MinusDM,Periods)/ATR(Periods);
A formula without an output statement returns the dreaded N/A status. You can take N/A to mean Nothing Available as an output. I trust this resolves your problem.
Roy
|