logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
kruupy  
#1 Posted : Friday, November 4, 2005 1:49:06 PM(UTC)
kruupy

Rank: Newbie

Groups: Registered, Registered Users
Joined: 10/27/2005(UTC)
Posts: 6

Hi all, I have recently been trying to code an explorer to use the Directional Movement System However, Although I can code the +DMI crossover with the -DMI, I cant code the ADX "increasing" . Is there a way to access the previous days ADX to compare it to todays to calculate whether the ADX is increasing or decreasing? Thankyou for everyones help on this issue!
mstt  
#2 Posted : Friday, November 4, 2005 5:56:18 PM(UTC)
mstt

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)
Kruppy Ref(ADX(14),-1) works fine for testing the value of the previous bars ADX. ADX() is rounded to a whole number so there is often no change between one bar and the next. Also, make sure that you force the exploration to use sufficient bars to calculate an accurate result. The "Load Minimum Records" setting won't do this - use at least 5 time as many bars as the ADX() "Periods" setting. Roy MetaStock Tips & Tools
kruupy  
#3 Posted : Sunday, November 6, 2005 12:51:25 AM(UTC)
kruupy

Rank: Newbie

Groups: Registered, Registered Users
Joined: 10/27/2005(UTC)
Posts: 6

Thankyou for your reply mstt, So if Ref(ADX(14),-1) wont work because of it rounding to whole numbers, how do you recommend I test for the ADX rising/decreasing?
mstt  
#4 Posted : Sunday, November 6, 2005 1:27:10 AM(UTC)
mstt

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)
Kruppy You could use the following formula for ADX, and use the Prec() function with the output line to set the number of decimal places for the result. One or two decimal places should be all you'd need. I think the PDI() and MDI() functions in MetaStock (also produced by this formula) use rounding too. Rounding appears to be the main difference between this formula and the "Directional Movement ADX" function in MetaStock. Don't take any notice of the "ADX Raw" tag. That's just what I use to identify it. {MetaStock code written by Equis and published in the Oct99 TASC} {ADX Raw} 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); 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); DIDif:=Abs(DIPlus - DIMinus); DISum:=DIPlus + DIMinus; 100*Wilders(DIDif/DISum,Periods); Roy MetaStock Tips & Tools
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.