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

Notification

Icon
Error

Options
Go to last post Go to first unread
wmadani  
#1 Posted : Friday, June 23, 2006 6:26:39 AM(UTC)
wmadani

Rank: Member

Groups: Registered, Registered Users
Joined: 4/28/2006(UTC)
Posts: 10

Hi, How to get an indicator value that is not rounded to the nearst whole number ? All the values I get out of ADX indicator are rounded . Thanks
wabbit  
#2 Posted : Friday, June 23, 2006 7:20:06 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
http://www.guppytraders.com/Metastock%20Formulas/metastock%20formula%2015.htm wrote:
Wilder wrote the original ADX in such a fashion that it rounds the readings out to the nearest whole number. The "regular" canned MetaStock ADX does this, while the custom ADX does not. The non-rounded readings are just a shade more sensitive, which can be helpful.
There are a few different variatiions on this code around the place... here is one take of it... --8<---------------------------- 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); ADXFinal --8<---------------------------- There are also some similar functions here: http://forum.equis.com/viewtopic.php?t=3770 Hope this helps. wabbit :D
wmadani  
#3 Posted : Friday, June 23, 2006 9:32:26 AM(UTC)
wmadani

Rank: Member

Groups: Registered, Registered Users
Joined: 4/28/2006(UTC)
Posts: 10

Thanks . I ploted the new code of the ADX as a custom indicator and I have also ploted the canned MS ADX .. however I get two different readings. the canned adx gave me a reading of 20.00 while the other one gave a reading of 18.7080 . I would of thought the difference between the two codes will always be less than .50 Am i making any sense here or I am missing some thing ? Thanks again for the reply
wabbit  
#4 Posted : Friday, June 23, 2006 9:46:05 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
It all depends on the when the formula rounding happens. Does it matter that the two values are different? Is the shape of the curve the same as the canned version? Do the day to day relative values match? That is what's important. Just adjust your trading rules to match the data you have. wabbit :D
wmadani  
#5 Posted : Friday, June 23, 2006 10:06:47 AM(UTC)
wmadani

Rank: Member

Groups: Registered, Registered Users
Joined: 4/28/2006(UTC)
Posts: 10

Thanks. That makes a lot of sense . One last question please; how can I have the MDI and PDI also ploted along with the new ADX ? Thanks gain .
wmadani  
#6 Posted : Friday, June 23, 2006 10:17:34 AM(UTC)
wmadani

Rank: Member

Groups: Registered, Registered Users
Joined: 4/28/2006(UTC)
Posts: 10

I would replace my previous question with this one ! :oops: How to refer to the new ADX in an exploration? Thanks
wabbit  
#7 Posted : Friday, June 23, 2006 11:43:26 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
MinusDI is the same as the MDI() PlusDI us the same as PDI() ADXFinal is the same as ADX so to plot all three lines on a single chart: 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); {plot} PlusDI; MinusDI; ADXFinal; In the explorer, put the entire formula into a column, lets say column A, and in your filter add the criteria, say colA>20, or whatever. If you need any more help, just ask. wabbit :D
wmadani  
#8 Posted : Friday, June 23, 2006 12:51:34 PM(UTC)
wmadani

Rank: Member

Groups: Registered, Registered Users
Joined: 4/28/2006(UTC)
Posts: 10

Every thing is clear now . Thanks alot for all the help and for being patient . Have a nice day.
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.