Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

PCF for Wilder's Directional Movement DMI-crossovers Topic Rating:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Tanstaafl
Posted : Thursday, December 9, 2004 4:23:03 PM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
PCF for Wilder's Directional Movement DMI-crossovers
(part of the ADX family of indicators)
Copyright 2004 by James D. Dean

Bad news and good news ... bad news first ...

A PCF/CI with 1% accuracy (vs an infinite series) that respects all
of Wilder's definition of a 14-day DM including his smoothing
method, and how he handles inside and outside days will require
approximately 2400 characters (about 60 days and 40 characters per
day).

A PCF/CI for the 14-day True Range using similar provisos will also
require about 2400 characters.

Since the DI is defined as the DM14 / TR14, it therefore requires
about 4800 characters for 1% accuracy using his smoothing, and still
remain true to Wilder's logic.

I've done it ... it works ... but it takes a loong time to move from
symbol to symbol if plotted as a CI.

Now the (sorta) good news ...

The crossover of Wilder's DM indicators is EXACTLY equivalent to the
crossover of the DI's (since DI = DM/TR and the TR's are the same for
both posDI and negDI ... so the formula is shorted significantly by
leaving out all the True Range gobbledegook.

So, it's reasonably practical to write (and live with) a PCF that
finds the DM-crossovers with soso accuracy (10% error vs infinite
Wilder series), but which is otherwise true to Wilder's
definitions.

Since there have been repeated requests for this in several venues,
I'm providing (below) the full PCF for a DM (=DI) crossover TODAY
vs YESTERDAY, based on a 32-term 10%-accurate expansion of the 14-
day Wilder's smoothing series. This *can* be plotted as a CI (for
checking purposes), but it makes the spacebar-action purty darn
sluggish. I recommend using it as a PCF, unless you are backtesting,
or just have a few stocks in your watchlist.

Please note that this PCF contains sections for both the posDM14 and
the negDM14 (today and yesterday), which you can break out if you
choose for other uses. For completeness, so that you can also create
posDI14 and negDI14 CI's and PCF's (with 10% error), I am also
including the 14-day Wilder's Smoothed True Range PCF at the end.

There is a LOT MORE to Wilder's system than just the DI-cross and
the ADX values ... the Extreme Point Rule is very important, as
is the rule regarding an ADX slope turndown when it is above the
DI's. But that's too much to cover, here :~)

If you compare the "hits" of this PCF to the native plotted DI-
crossovers, you'll find that most cases agree, but there are some
where the DI lines don't match up. That's the nature of the beast,
re the error created by the series-truncation. A PCF which provides
accuracy equivalent to the native plots would be 2-3x as long as the
one below. If anyone is truly interested in getting a copy of that,
please email me directly about it.


14dWiMA10% DM-Crossover (Long):
Use 10% accuracy to limit length, and

posDM(14w) today > negDM(14w) today
and
posDM(14w) yester < negDM(14w) yester

78.78*(H1-H0)*(H1-H0<L0-L1 and H0>H1)
+73.16*(H2-H1)*(H2-H1<L1-L2 and H1>H2)
+67.93*(H3-H2)*(H3-H2<L2-L3 and H2>H3)
+63.08*(H4-H3)*(H4-H3<L3-L4 and H3>H4)
+58.57*(H5-H4)*(H5-H4<L4-L5 and H4>H5)
+54.39*(H6-H5)*(H6-H5<L5-L6 and H5>H6)
+50.5*(H7-H6)*(H7-H6<L6-L7 and H6>H7)
+46.9*(H8-H7)*(H8-H7<L7-L8 and H7>H8)
+43.55*(H9-H8)*(H9-H8<L8-L9 and H8>H9)
+40.44*(H10-H9)*(H10-H9<L9-L10 and H9>H10)
+37.55*(H11-H10)*(H11-H10<L10-L11 and H10>H11)
+34.87*(H12-H11)*(H12-H11<L11-L12 and H11>H12)
+32.38*(H13-H12)*(H13-H12<L12-L13 and H12>H13)
+30.06*(H14-H13)*(H14-H13<L13-L14 and H13>H14)
+27.92*(H15-H14)*(H15-H14<L14-L15 and H14>H15)
+25.92*(H16-H15)*(H16-H15<L15-L16 and H15>H16)
+24.07*(H17-H16)*(H17-H16<L16-L17 and H16>H17)
+22.35*(H18-H17)*(H18-H17<L17-L18 and H17>H18)
+20.75*(H19-H18)*(H19-H18<L18-L19 and H18>H19)
+19.27*(H20-H19)*(H20-H19<L19-L20 and H19>H20)
+17.9*(H21-H20)*(H21-H20<L20-L21 and H20>H21)
+16.62*(H22-H21)*(H22-H21<L21-L22 and H21>H22)
+15.43*(H23-H22)*(H23-H22<L22-L23 and H22>H23)
+14.33*(H24-H23)*(H24-H23<L23-L24 and H23>H24)
+13.3*(H25-H24)*(H25-H24<L24-L25 and H24>H25)
+12.35*(H26-H25)*(H26-H25<L25-L26 and H25>H26)
+11.47*(H27-H26)*(H27-H26<L26-L27 and H26>H27)
+10.65*(H28-H27)*(H28-H27<L27-L28 and H27>H28)
+9.89*(H29-H28)*(H29-H28<L28-L29 and H28>H29)
+9.18*(H30-H29)*(H30-H29<L29-L30 and H29>H30)
+8.53*(H31-H30)*(H31-H30<L30-L31 and H30>H31)
+7.92*(H32-H31)*(H32-H31<L31-L32 and H31>H32)
>
78.78*(L0-L1)*(H1-H0>L0-L1 and L0<L1)
+73.16*(L1-L2)*(H2-H1>L1-L2 and L1<L2)
+67.93*(L2-L3)*(H3-H2>L2-L3 and L2<L3)
+63.08*(L3-L4)*(H4-H3>L3-L4 and L3<L4)
+58.57*(L4-L5)*(H5-H4>L4-L5 and L4<L5)
+54.39*(L5-L6)*(H6-H5>L5-L6 and L5<L6)
+50.5*(L6-L7)*(H7-H6>L6-L7 and L6<L7)
+46.9*(L7-L8)*(H8-H7>L7-L8 and L7<L8)
+43.55*(L8-L9)*(H9-H8>L8-L9 and L8<L9)
+40.44*(L9-L10)*(H10-H9>L9-L10 and L9<L10)
+37.55*(L10-L11)*(H11-H10>L10-L11 and L10<L11)
+34.87*(L11-L12)*(H12-H11>L11-L12 and L11<L12)
+32.38*(L12-L13)*(H13-H12>L12-L13 and L12<L13)
+30.06*(L13-L14)*(H14-H13>L13-L14 and L13<L14)
+27.92*(L14-L15)*(H15-H14>L14-L15 and L14<L15)
+25.92*(L15-L16)*(H16-H15>L15-L16 and L15<L16)
+24.07*(L16-L17)*(H17-H16>L16-L17 and L16<L17)
+22.35*(L17-L18)*(H18-H17>L17-L18 and L17<L18)
+20.75*(L18-L19)*(H19-H18>L18-L19 and L18<L19)
+19.27*(L19-L20)*(H20-H19>L19-L20 and L19<L20)
+17.9*(L20-L21)*(H21-H20>L20-L21 and L20<L21)
+16.62*(L21-L22)*(H22-H21>L21-L22 and L21<L22)
+15.43*(L22-L23)*(H23-H22>L22-L23 and L22<L23)
+14.33*(L23-L24)*(H24-H23>L23-L24 and L23<L24)
+13.3*(L24-L25)*(H25-H24>L24-L25 and L24<L25)
+12.35*(L25-L26)*(H26-H25>L25-L26 and L25<L26)
+11.47*(L26-L27)*(H27-H26>L26-L27 and L26<L27)
+10.65*(L27-L28)*(H28-H27>L27-L28 and L27<L28)
+9.89*(L28-L29)*(H29-H28>L28-L29 and L28<L29)
+9.18*(L29-L30)*(H30-H29>L29-L30 and L29<L30)
+8.53*(L30-L31)*(H31-H30>L30-L31 and L30<L31)
+7.92*(L31-L32)*(H32-H31>L31-L32 and L31<L32)
and
78.78*(H2-H1)*(H2-H1<L1-L2 and H1>H2)
+73.16*(H3-H2)*(H3-H2<L2-L3 and H2>H3)
+67.93*(H4-H3)*(H4-H3<L3-L4 and H3>H4)
+63.08*(H5-H4)*(H5-H4<L4-L5 and H4>H5)
+58.57*(H6-H5)*(H6-H5<L5-L6 and H5>H6)
+54.39*(H7-H6)*(H7-H6<L6-L7 and H6>H7)
+50.5*(H8-H7)*(H8-H7<L7-L8 and H7>H8)
+46.9*(H9-H8)*(H9-H8<L8-L9 and H8>H9)
+43.55*(H10-H9)*(H10-H9<L9-L10 and H9>H10)
+40.44*(H11-H10)*(H11-H10<L10-L11 and H10>H11)
+37.55*(H12-H11)*(H12-H11<L11-L12 and H11>H12)
+34.87*(H13-H12)*(H13-H12<L12-L13 and H12>H13)
+32.38*(H14-H13)*(H14-H13<L13-L14 and H13>H14)
+30.06*(H15-H14)*(H15-H14<L14-L15 and H14>H15)
+27.92*(H16-H15)*(H16-H15<L15-L16 and H15>H16)
+25.92*(H17-H16)*(H17-H16<L16-L17 and H16>H17)
+24.07*(H18-H17)*(H18-H17<L17-L18 and H17>H18)
+22.35*(H19-H18)*(H19-H18<L18-L19 and H18>H19)
+20.75*(H20-H19)*(H20-H19<L19-L20 and H19>H20)
+19.27*(H21-H20)*(H21-H20<L20-L21 and H20>H21)
+17.9*(H22-H21)*(H22-H21<L21-L22 and H21>H22)
+16.62*(H23-H22)*(H23-H22<L22-L23 and H22>H23)
+15.43*(H24-H23)*(H24-H23<L23-L24 and H23>H24)
+14.33*(H25-H24)*(H25-H24<L24-L25 and H24>H25)
+13.3*(H26-H25)*(H26-H25<L25-L26 and H25>H26)
+12.35*(H27-H26)*(H27-H26<L26-L27 and H26>H27)
+11.47*(H28-H27)*(H28-H27<L27-L28 and H27>H28)
+10.65*(H29-H28)*(H29-H28<L28-L29 and H28>H29)
+9.89*(H30-H29)*(H30-H29<L29-L30 and H29>H30)
+9.18*(H31-H30)*(H31-H30<L30-L31 and H30>H31)
+8.53*(H32-H31)*(H32-H31<L31-L32 and H31>H32)
+7.92*(H33-H32)*(H33-H32<L32-L33 and H32>H33)
<
78.78*(L1-L2)*(H2-H1>L1-L2 and L1<L2)
+73.16*(L2-L3)*(H3-H2>L2-L3 and L2<L3)
+67.93*(L3-L4)*(H4-H3>L3-L4 and L3<L4)
+63.08*(L4-L5)*(H5-H4>L4-L5 and L4<L5)
+58.57*(L5-L6)*(H6-H5>L5-L6 and L5<L6)
+54.39*(L6-L7)*(H7-H6>L6-L7 and L6<L7)
+50.5*(L7-L8)*(H8-H7>L7-L8 and L7<L8)
+46.9*(L8-L9)*(H9-H8>L8-L9 and L8<L9)
+43.55*(L9-L10)*(H10-H9>L9-L10 and L9<L10)
+40.44*(L10-L11)*(H11-H10>L10-L11 and L10<L11)
+37.55*(L11-L12)*(H12-H11>L11-L12 and L11<L12)
+34.87*(L12-L13)*(H13-H12>L12-L13 and L12<L13)
+32.38*(L13-L14)*(H14-H13>L13-L14 and L13<L14)
+30.06*(L14-L15)*(H15-H14>L14-L15 and L14<L15)
+27.92*(L15-L16)*(H16-H15>L15-L16 and L15<L16)
+25.92*(L16-L17)*(H17-H16>L16-L17 and L16<L17)
+24.07*(L17-L18)*(H18-H17>L17-L18 and L17<L18)
+22.35*(L18-L19)*(H19-H18>L18-L19 and L18<L19)
+20.75*(L19-L20)*(H20-H19>L19-L20 and L19<L20)
+19.27*(L20-L21)*(H21-H20>L20-L21 and L20<L21)
+17.9*(L21-L22)*(H22-H21>L21-L22 and L21<L22)
+16.62*(L22-L23)*(H23-H22>L22-L23 and L22<L23)
+15.43*(L23-L24)*(H24-H23>L23-L24 and L23<L24)
+14.33*(L24-L25)*(H25-H24>L24-L25 and L24<L25)
+13.3*(L25-L26)*(H26-H25>L25-L26 and L25<L26)
+12.35*(L26-L27)*(H27-H26>L26-L27 and L26<L27)
+11.47*(L27-L28)*(H28-H27>L27-L28 and L27<L28)
+10.65*(L28-L29)*(H29-H28>L28-L29 and L28<L29)
+9.89*(L29-L30)*(H30-H29>L29-L30 and L29<L30)
+9.18*(L30-L31)*(H31-H30>L30-L31 and L30<L31)
+8.53*(L31-L32)*(H32-H31>L31-L32 and L31<L32)
+7.92*(L32-L33)*(H33-H32>L32-L33 and L32<L33)

===============================================

Wilder's TrueRange today = 14dWtdAvg(TrueRange)
(divide DM14's by this formula to get DI14's)

(78.78*(H0-L0+Abs(H0-C1)+Abs(L0-C1))
+73.16*(H1-L1+Abs(H1-C2)+Abs(L1-C2))
+67.93*(H2-L2+Abs(H2-C3)+Abs(L2-C3))
+63.08*(H3-L3+Abs(H3-C4)+Abs(L3-C4))
+58.57*(H4-L4+Abs(H4-C5)+Abs(L4-C5))
+54.39*(H5-L5+Abs(H5-C6)+Abs(L5-C6))
+50.5*(H6-L6+Abs(H6-C7)+Abs(L6-C7))
+46.9*(H7-L7+Abs(H7-C8)+Abs(L7-C8))
+43.55*(H8-L8+Abs(H8-C9)+Abs(L8-C9))
+40.44*(H9-L9+Abs(H9-C10)+Abs(L9-C10))
+37.55*(H10-L10+Abs(H10-C11)+Abs(L10-C11))
+34.87*(H11-L11+Abs(H11-C12)+Abs(L11-C12))
+32.38*(H12-L12+Abs(H12-C13)+Abs(L12-C13))
+30.06*(H13-L13+Abs(H13-C14)+Abs(L13-C14))
+27.92*(H14-L14+Abs(H14-C15)+Abs(L14-C15))
+25.92*(H15-L15+Abs(H15-C16)+Abs(L15-C16))
+24.07*(H16-L16+Abs(H16-C17)+Abs(L16-C17))
+22.35*(H17-L17+Abs(H17-C18)+Abs(L17-C18))
+20.75*(H18-L18+Abs(H18-C19)+Abs(L18-C19))
+19.27*(H19-L19+Abs(H19-C20)+Abs(L19-C20))
+17.9*(H20-L20+Abs(H20-C21)+Abs(L20-C21))
+16.62*(H21-L21+Abs(H21-C22)+Abs(L21-C22))
+15.43*(H22-L22+Abs(H22-C23)+Abs(L22-C23))
+14.33*(H23-L23+Abs(H23-C24)+Abs(L23-C24))
+13.3*(H24-L24+Abs(H24-C25)+Abs(L24-C25))
+12.35*(H25-L25+Abs(H25-C26)+Abs(L25-C26))
+11.47*(H26-L26+Abs(H26-C27)+Abs(L26-C27))
+10.65*(H27-L27+Abs(H27-C28)+Abs(L27-C28))
+9.89*(H28-L28+Abs(H28-C29)+Abs(L28-C29))
+9.18*(H29-L29+Abs(H29-C30)+Abs(L29-C30))
+8.53*(H30-L30+Abs(H30-C31)+Abs(L30-C31))
+7.92*(H31-L31+Abs(H31-C32)+Abs(L31-C32)))/2

Craig_S
Posted : Thursday, December 9, 2004 4:39:55 PM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
Let me be the first to say THANKS! You are very generous to share this with our growing community.

I want to warn people that these formulas, if put into your TeleChart, will greatly affect the performance of the criteria calculation. If put in as a custom indicator, the speed of the charting module will grind to a slow pace as well.

Does this mean don't use them? No it does not! I do want you to know that if you use them it will slow the program down considerably.

Thanks again for sharing!

- Craig
Here to Help!
Tanstaafl
Posted : Thursday, December 9, 2004 5:41:08 PM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
You betcha, Craig ... I'd advise against using it as a CI, but as a PCF it's probably OK since you can just have a few more sips of coffee. This formula is a great illustration of why W needs to add the ADX/DMI functions to the PCF language, so that we can have accuracy as well as speed. In fact, just allowing the use of SortBy with the current DI lines would permit reasonably efficient identification of posDI > negDI cases.

I know what you're gonna say ... post it as a request. Welp, I've done so many times ... even during Alpha testing last Dec when ADX was first make available in the pre-2.3 release. I guess we just gotta wait till the dot-NET transition to TC2005 is settled.

Tanstaafl
Posted : Monday, December 13, 2004 5:25:43 PM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Followup to my original posting ... you can speed up the PCF a bit by changing the structure of each of the Rows in the big crossover PCF as follows:

Original form:
78.78*(H1-H0)*(H1-H0<L0-L1 and H0>H1)

Faster form:
78.78*(H0-H1)*(H1-H0<L0-L1)*(H0>H1)

Please note that the H1-H0 has been reversed to its "natural" form, since if both the two following boolean terms are true, each will become a minus one, so the minus sign goes away when you multiply them.

You need to apply this alteration to every row of the formula.

The True Range calc is already fully speed-optimized.

Jim Dean

Tanstaafl
Posted : Monday, December 13, 2004 8:27:28 PM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
I decided to take pity on all your fingers typing madly to revise the formula :~), so I created a revised version for you from my Excel autogen sheet. This is a replacement for the long bullish-DMI-crossover PCF listed above:

78.78*(H0-H1)*(H0-H1>L1-L0)*(H0>H1)
+73.16*(H1-H2)*(H1-H2>L2-L1)*(H1>H2)
+67.93*(H2-H3)*(H2-H3>L3-L2)*(H2>H3)
+63.08*(H3-H4)*(H3-H4>L4-L3)*(H3>H4)
+58.57*(H4-H5)*(H4-H5>L5-L4)*(H4>H5)
+54.39*(H5-H6)*(H5-H6>L6-L5)*(H5>H6)
+50.5*(H6-H7)*(H6-H7>L7-L6)*(H6>H7)
+46.9*(H7-H8)*(H7-H8>L8-L7)*(H7>H8)
+43.55*(H8-H9)*(H8-H9>L9-L8)*(H8>H9)
+40.44*(H9-H10)*(H9-H10>L10-L9)*(H9>H10)
+37.55*(H10-H11)*(H10-H11>L11-L10)*(H10>H11)
+34.87*(H11-H12)*(H11-H12>L12-L11)*(H11>H12)
+32.38*(H12-H13)*(H12-H13>L13-L12)*(H12>H13)
+30.06*(H13-H14)*(H13-H14>L14-L13)*(H13>H14)
+27.92*(H14-H15)*(H14-H15>L15-L14)*(H14>H15)
+25.92*(H15-H16)*(H15-H16>L16-L15)*(H15>H16)
+24.07*(H16-H17)*(H16-H17>L17-L16)*(H16>H17)
+22.35*(H17-H18)*(H17-H18>L18-L17)*(H17>H18)
+20.75*(H18-H19)*(H18-H19>L19-L18)*(H18>H19)
+19.27*(H19-H20)*(H19-H20>L20-L19)*(H19>H20)
+17.9*(H20-H21)*(H20-H21>L21-L20)*(H20>H21)
+16.62*(H21-H22)*(H21-H22>L22-L21)*(H21>H22)
+15.43*(H22-H23)*(H22-H23>L23-L22)*(H22>H23)
+14.33*(H23-H24)*(H23-H24>L24-L23)*(H23>H24)
+13.3*(H24-H25)*(H24-H25>L25-L24)*(H24>H25)
+12.35*(H25-H26)*(H25-H26>L26-L25)*(H25>H26)
+11.47*(H26-H27)*(H26-H27>L27-L26)*(H26>H27)
+10.65*(H27-H28)*(H27-H28>L28-L27)*(H27>H28)
+9.89*(H28-H29)*(H28-H29>L29-L28)*(H28>H29)
+9.18*(H29-H30)*(H29-H30>L30-L29)*(H29>H30)
+8.53*(H30-H31)*(H30-H31>L31-L30)*(H30>H31)
+7.92*(H31-H32)*(H31-H32>L32-L31)*(H31>H32)
>
78.78*(L1-L0)*(H0-H1<L1-L0)*(L0<L1)
+73.16*(L2-L1)*(H1-H2<L2-L1)*(L1<L2)
+67.93*(L3-L2)*(H2-H3<L3-L2)*(L2<L3)
+63.08*(L4-L3)*(H3-H4<L4-L3)*(L3<L4)
+58.57*(L5-L4)*(H4-H5<L5-L4)*(L4<L5)
+54.39*(L6-L5)*(H5-H6<L6-L5)*(L5<L6)
+50.5*(L7-L6)*(H6-H7<L7-L6)*(L6<L7)
+46.9*(L8-L7)*(H7-H8<L8-L7)*(L7<L8)
+43.55*(L9-L8)*(H8-H9<L9-L8)*(L8<L9)
+40.44*(L10-L9)*(H9-H10<L10-L9)*(L9<L10)
+37.55*(L11-L10)*(H10-H11<L11-L10)*(L10<L11)
+34.87*(L12-L11)*(H11-H12<L12-L11)*(L11<L12)
+32.38*(L13-L12)*(H12-H13<L13-L12)*(L12<L13)
+30.06*(L14-L13)*(H13-H14<L14-L13)*(L13<L14)
+27.92*(L15-L14)*(H14-H15<L15-L14)*(L14<L15)
+25.92*(L16-L15)*(H15-H16<L16-L15)*(L15<L16)
+24.07*(L17-L16)*(H16-H17<L17-L16)*(L16<L17)
+22.35*(L18-L17)*(H17-H18<L18-L17)*(L17<L18)
+20.75*(L19-L18)*(H18-H19<L19-L18)*(L18<L19)
+19.27*(L20-L19)*(H19-H20<L20-L19)*(L19<L20)
+17.9*(L21-L20)*(H20-H21<L21-L20)*(L20<L21)
+16.62*(L22-L21)*(H21-H22<L22-L21)*(L21<L22)
+15.43*(L23-L22)*(H22-H23<L23-L22)*(L22<L23)
+14.33*(L24-L23)*(H23-H24<L24-L23)*(L23<L24)
+13.3*(L25-L24)*(H24-H25<L25-L24)*(L24<L25)
+12.35*(L26-L25)*(H25-H26<L26-L25)*(L25<L26)
+11.47*(L27-L26)*(H26-H27<L27-L26)*(L26<L27)
+10.65*(L28-L27)*(H27-H28<L28-L27)*(L27<L28)
+9.89*(L29-L28)*(H28-H29<L29-L28)*(L28<L29)
+9.18*(L30-L29)*(H29-H30<L30-L29)*(L29<L30)
+8.53*(L31-L30)*(H30-H31<L31-L30)*(L30<L31)
+7.92*(L32-L31)*(H31-H32<L32-L31)*(L31<L32)
and
78.78*(H1-H2)*(H1-H2>L2-L1)*(H1>H2)
+73.16*(H2-H3)*(H2-H3>L3-L2)*(H2>H3)
+67.93*(H3-H4)*(H3-H4>L4-L3)*(H3>H4)
+63.08*(H4-H5)*(H4-H5>L5-L4)*(H4>H5)
+58.57*(H5-H6)*(H5-H6>L6-L5)*(H5>H6)
+54.39*(H6-H7)*(H6-H7>L7-L6)*(H6>H7)
+50.5*(H7-H8)*(H7-H8>L8-L7)*(H7>H8)
+46.9*(H8-H9)*(H8-H9>L9-L8)*(H8>H9)
+43.55*(H9-H10)*(H9-H10>L10-L9)*(H9>H10)
+40.44*(H10-H11)*(H10-H11>L11-L10)*(H10>H11)
+37.55*(H11-H12)*(H11-H12>L12-L11)*(H11>H12)
+34.87*(H12-H13)*(H12-H13>L13-L12)*(H12>H13)
+32.38*(H13-H14)*(H13-H14>L14-L13)*(H13>H14)
+30.06*(H14-H15)*(H14-H15>L15-L14)*(H14>H15)
+27.92*(H15-H16)*(H15-H16>L16-L15)*(H15>H16)
+25.92*(H16-H17)*(H16-H17>L17-L16)*(H16>H17)
+24.07*(H17-H18)*(H17-H18>L18-L17)*(H17>H18)
+22.35*(H18-H19)*(H18-H19>L19-L18)*(H18>H19)
+20.75*(H19-H20)*(H19-H20>L20-L19)*(H19>H20)
+19.27*(H20-H21)*(H20-H21>L21-L20)*(H20>H21)
+17.9*(H21-H22)*(H21-H22>L22-L21)*(H21>H22)
+16.62*(H22-H23)*(H22-H23>L23-L22)*(H22>H23)
+15.43*(H23-H24)*(H23-H24>L24-L23)*(H23>H24)
+14.33*(H24-H25)*(H24-H25>L25-L24)*(H24>H25)
+13.3*(H25-H26)*(H25-H26>L26-L25)*(H25>H26)
+12.35*(H26-H27)*(H26-H27>L27-L26)*(H26>H27)
+11.47*(H27-H28)*(H27-H28>L28-L27)*(H27>H28)
+10.65*(H28-H29)*(H28-H29>L29-L28)*(H28>H29)
+9.89*(H29-H30)*(H29-H30>L30-L29)*(H29>H30)
+9.18*(H30-H31)*(H30-H31>L31-L30)*(H30>H31)
+8.53*(H31-H32)*(H31-H32>L32-L31)*(H31>H32)
+7.92*(H32-H33)*(H32-H33>L33-L32)*(H32>H33)
<
78.78*(L2-L1)*(H1-H2<L2-L1)*(L1<L2)
+73.16*(L3-L2)*(H2-H3<L3-L2)*(L2<L3)
+67.93*(L4-L3)*(H3-H4<L4-L3)*(L3<L4)
+63.08*(L5-L4)*(H4-H5<L5-L4)*(L4<L5)
+58.57*(L6-L5)*(H5-H6<L6-L5)*(L5<L6)
+54.39*(L7-L6)*(H6-H7<L7-L6)*(L6<L7)
+50.5*(L8-L7)*(H7-H8<L8-L7)*(L7<L8)
+46.9*(L9-L8)*(H8-H9<L9-L8)*(L8<L9)
+43.55*(L10-L9)*(H9-H10<L10-L9)*(L9<L10)
+40.44*(L11-L10)*(H10-H11<L11-L10)*(L10<L11)
+37.55*(L12-L11)*(H11-H12<L12-L11)*(L11<L12)
+34.87*(L13-L12)*(H12-H13<L13-L12)*(L12<L13)
+32.38*(L14-L13)*(H13-H14<L14-L13)*(L13<L14)
+30.06*(L15-L14)*(H14-H15<L15-L14)*(L14<L15)
+27.92*(L16-L15)*(H15-H16<L16-L15)*(L15<L16)
+25.92*(L17-L16)*(H16-H17<L17-L16)*(L16<L17)
+24.07*(L18-L17)*(H17-H18<L18-L17)*(L17<L18)
+22.35*(L19-L18)*(H18-H19<L19-L18)*(L18<L19)
+20.75*(L20-L19)*(H19-H20<L20-L19)*(L19<L20)
+19.27*(L21-L20)*(H20-H21<L21-L20)*(L20<L21)
+17.9*(L22-L21)*(H21-H22<L22-L21)*(L21<L22)
+16.62*(L23-L22)*(H22-H23<L23-L22)*(L22<L23)
+15.43*(L24-L23)*(H23-H24<L24-L23)*(L23<L24)
+14.33*(L25-L24)*(H24-H25<L25-L24)*(L24<L25)
+13.3*(L26-L25)*(H25-H26<L26-L25)*(L25<L26)
+12.35*(L27-L26)*(H26-H27<L27-L26)*(L26<L27)
+11.47*(L28-L27)*(H27-H28<L28-L27)*(L27<L28)
+10.65*(L29-L28)*(H28-H29<L29-L28)*(L28<L29)
+9.89*(L30-L29)*(H29-H30<L30-L29)*(L29<L30)
+9.18*(L31-L30)*(H30-H31<L31-L30)*(L30<L31)
+8.53*(L32-L31)*(H31-H32<L32-L31)*(L31<L32)
+7.92*(L33-L32)*(H32-H33<L33-L32)*(L32<L33)




achampagne
Posted : Tuesday, December 14, 2004 12:19:52 PM
Registered User
Joined: 10/14/2004
Posts: 7
Tanstaafl and Craig,

Can you not just do a visual sort comparison to find crossovers? Maybe I am missing the point, but I thought one of the reasons for sorting is to see crossovers fairly easily.

Please correct me if I am wrong,

Alan
Craig_S
Posted : Tuesday, December 14, 2004 12:30:03 PM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
As of right now you can only visually sort by the actual ADX line. You can have the DIs plotted but they cannot be visually sorted. I would love to see this added in the future. Sure would save having to use these system-slowing PCFs!

- Craig
Here to Help!
Tanstaafl
Posted : Tuesday, December 14, 2004 12:44:45 PM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Hi, Champ:

I agree with Craig's comments, and his sentiments

You can, however, get halfway to where you wanted to be, using the current version.

Just separate out the first two of the four sections of the long crossover-PCF above, into two separate "posDMI" and "negDMI" custom indicators, plot them, and SortBy Comparisons will work great.

Note that as CI's, they will be PLOTTED on DIFFERENT SCALES ... so visible crossovers are meaningless ... but of course you have the "real thing" for that.

If you plot BOTH of these two CI's on the TOP pane, then by putting up the pointer+databox, you can scroll backwards thru time, watching the DMI values in the databox, to see how closely they agree (re crossovers) with the "true" DI plots. IMHO, it's good enough.

NOTE that the formulae are NOT DI's ... I removed the true range and the divisors for simplicity ... but mathematically, their crossovers will occur on EXACTLY the same bar as forumulae that had the TR's in them would ... with the proviso, of course, that these are only 32-bar series and therefore have ~10% error.


achampagne
Posted : Tuesday, December 14, 2004 2:00:55 PM
Registered User
Joined: 10/14/2004
Posts: 7
Craig and Tanstaafl,

After reading your post, I said to myself "of course." Darn, thought I had the answer.

I will look forward to other posts to this list and work with the material Tanstaafl has provided. Thanks to both of you.

Alan
Tanstaafl
Posted : Tuesday, December 14, 2004 3:19:27 PM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
OK ... here's still ANOTHER pair of improvements to make the DMI-crossover PCF more efficient, without changing its accuracy (which by the way is pretty good) ... this actually DOUBLES the information value of the calculation (Bull and Bear ID's all in one), but runs FASTER than the Bull-only original version (no bull! :~)

DMI-crossover, WiMA14, 10%error

The per-bar calc's have been improved in
2 ways: the use of multiplication instead
of "and" for the last () term of each bar,
and by combining the two into a single series
(using subtraction) on either side of the
main "and" between today and yesterday.

That is:
posDMtoday > negDMtoday
and
posDMyester < negDMyester

becomes:
(posDMtoday - negDMtoday) > 0
and
(posDMyester - negDMyester) < 0

But we can take this a step further, by
using the SGN() function on the pos-neg
differences. This allows us to get BOTH
a Bull and Bear crossover test all in one.

SGN(posDMtoday - negDMtoday)
-
SGN(posDMyester - negDMyester)

there are four possible outcomes:
-1 - +1 = -2 = bear cross
+1 - -1 = +2 = bull cross
-1 - -1 = 0 = no cross
+1 - +1 = 0 = no cross

So, without requiring ANY extra terms,
we get a formula that reports a +2 for
a Bullish DMI cross, or -2 for Bearish,
or zero if no cross occurred!

SGN(
78.78*((H0-H1)*(H0-H1>L1-L0)*(H0>H1) - (L1-L0)*(H0-H1<L1-L0)*(L0<L1))
+73.16*((H1-H2)*(H1-H2>L2-L1)*(H1>H2) - (L2-L1)*(H1-H2<L2-L1)*(L1<L2))
+67.93*((H2-H3)*(H2-H3>L3-L2)*(H2>H3) - (L3-L2)*(H2-H3<L3-L2)*(L2<L3))
+63.08*((H3-H4)*(H3-H4>L4-L3)*(H3>H4) - (L4-L3)*(H3-H4<L4-L3)*(L3<L4))
+58.57*((H4-H5)*(H4-H5>L5-L4)*(H4>H5) - (L5-L4)*(H4-H5<L5-L4)*(L4<L5))
+54.39*((H5-H6)*(H5-H6>L6-L5)*(H5>H6) - (L6-L5)*(H5-H6<L6-L5)*(L5<L6))
+50.5*((H6-H7)*(H6-H7>L7-L6)*(H6>H7) - (L7-L6)*(H6-H7<L7-L6)*(L6<L7))
+46.9*((H7-H8)*(H7-H8>L8-L7)*(H7>H8) - (L8-L7)*(H7-H8<L8-L7)*(L7<L8))
+43.55*((H8-H9)*(H8-H9>L9-L8)*(H8>H9) - (L9-L8)*(H8-H9<L9-L8)*(L8<L9))
+40.44*((H9-H10)*(H9-H10>L10-L9)*(H9>H10) - (L10-L9)*(H9-H10<L10-L9)*(L9<L10))
+37.55*((H10-H11)*(H10-H11>L11-L10)*(H10>H11) - (L11-L10)*(H10-H11<L11-L10)*(L10<L11))
+34.87*((H11-H12)*(H11-H12>L12-L11)*(H11>H12) - (L12-L11)*(H11-H12<L12-L11)*(L11<L12))
+32.38*((H12-H13)*(H12-H13>L13-L12)*(H12>H13) - (L13-L12)*(H12-H13<L13-L12)*(L12<L13))
+30.06*((H13-H14)*(H13-H14>L14-L13)*(H13>H14) - (L14-L13)*(H13-H14<L14-L13)*(L13<L14))
+27.92*((H14-H15)*(H14-H15>L15-L14)*(H14>H15) - (L15-L14)*(H14-H15<L15-L14)*(L14<L15))
+25.92*((H15-H16)*(H15-H16>L16-L15)*(H15>H16) - (L16-L15)*(H15-H16<L16-L15)*(L15<L16))
+24.07*((H16-H17)*(H16-H17>L17-L16)*(H16>H17) - (L17-L16)*(H16-H17<L17-L16)*(L16<L17))
+22.35*((H17-H18)*(H17-H18>L18-L17)*(H17>H18) - (L18-L17)*(H17-H18<L18-L17)*(L17<L18))
+20.75*((H18-H19)*(H18-H19>L19-L18)*(H18>H19) - (L19-L18)*(H18-H19<L19-L18)*(L18<L19))
+19.27*((H19-H20)*(H19-H20>L20-L19)*(H19>H20) - (L20-L19)*(H19-H20<L20-L19)*(L19<L20))
+17.9*((H20-H21)*(H20-H21>L21-L20)*(H20>H21) - (L21-L20)*(H20-H21<L21-L20)*(L20<L21))
+16.62*((H21-H22)*(H21-H22>L22-L21)*(H21>H22) - (L22-L21)*(H21-H22<L22-L21)*(L21<L22))
+15.43*((H22-H23)*(H22-H23>L23-L22)*(H22>H23) - (L23-L22)*(H22-H23<L23-L22)*(L22<L23))
+14.33*((H23-H24)*(H23-H24>L24-L23)*(H23>H24) - (L24-L23)*(H23-H24<L24-L23)*(L23<L24))
+13.3*((H24-H25)*(H24-H25>L25-L24)*(H24>H25) - (L25-L24)*(H24-H25<L25-L24)*(L24<L25))
+12.35*((H25-H26)*(H25-H26>L26-L25)*(H25>H26) - (L26-L25)*(H25-H26<L26-L25)*(L25<L26))
+11.47*((H26-H27)*(H26-H27>L27-L26)*(H26>H27) - (L27-L26)*(H26-H27<L27-L26)*(L26<L27))
+10.65*((H27-H28)*(H27-H28>L28-L27)*(H27>H28) - (L28-L27)*(H27-H28<L28-L27)*(L27<L28))
+9.89*((H28-H29)*(H28-H29>L29-L28)*(H28>H29) - (L29-L28)*(H28-H29<L29-L28)*(L28<L29))
+9.18*((H29-H30)*(H29-H30>L30-L29)*(H29>H30) - (L30-L29)*(H29-H30<L30-L29)*(L29<L30))
+8.53*((H30-H31)*(H30-H31>L31-L30)*(H30>H31) - (L31-L30)*(H30-H31<L31-L30)*(L30<L31))
+7.92*((H31-H32)*(H31-H32>L32-L31)*(H31>H32) - (L32-L31)*(H31-H32<L32-L31)*(L31<L32))
) - SGN(
78.78*((H1-H2)*(H1-H2>L2-L1)*(H1>H2) - (L2-L1)*(H1-H2<L2-L1)*(L1<L2))
+73.16*((H2-H3)*(H2-H3>L3-L2)*(H2>H3) - (L3-L2)*(H2-H3<L3-L2)*(L2<L3))
+67.93*((H3-H4)*(H3-H4>L4-L3)*(H3>H4) - (L4-L3)*(H3-H4<L4-L3)*(L3<L4))
+63.08*((H4-H5)*(H4-H5>L5-L4)*(H4>H5) - (L5-L4)*(H4-H5<L5-L4)*(L4<L5))
+58.57*((H5-H6)*(H5-H6>L6-L5)*(H5>H6) - (L6-L5)*(H5-H6<L6-L5)*(L5<L6))
+54.39*((H6-H7)*(H6-H7>L7-L6)*(H6>H7) - (L7-L6)*(H6-H7<L7-L6)*(L6<L7))
+50.5*((H7-H8)*(H7-H8>L8-L7)*(H7>H8) - (L8-L7)*(H7-H8<L8-L7)*(L7<L8))
+46.9*((H8-H9)*(H8-H9>L9-L8)*(H8>H9) - (L9-L8)*(H8-H9<L9-L8)*(L8<L9))
+43.55*((H9-H10)*(H9-H10>L10-L9)*(H9>H10) - (L10-L9)*(H9-H10<L10-L9)*(L9<L10))
+40.44*((H10-H11)*(H10-H11>L11-L10)*(H10>H11) - (L11-L10)*(H10-H11<L11-L10)*(L10<L11))
+37.55*((H11-H12)*(H11-H12>L12-L11)*(H11>H12) - (L12-L11)*(H11-H12<L12-L11)*(L11<L12))
+34.87*((H12-H13)*(H12-H13>L13-L12)*(H12>H13) - (L13-L12)*(H12-H13<L13-L12)*(L12<L13))
+32.38*((H13-H14)*(H13-H14>L14-L13)*(H13>H14) - (L14-L13)*(H13-H14<L14-L13)*(L13<L14))
+30.06*((H14-H15)*(H14-H15>L15-L14)*(H14>H15) - (L15-L14)*(H14-H15<L15-L14)*(L14<L15))
+27.92*((H15-H16)*(H15-H16>L16-L15)*(H15>H16) - (L16-L15)*(H15-H16<L16-L15)*(L15<L16))
+25.92*((H16-H17)*(H16-H17>L17-L16)*(H16>H17) - (L17-L16)*(H16-H17<L17-L16)*(L16<L17))
+24.07*((H17-H18)*(H17-H18>L18-L17)*(H17>H18) - (L18-L17)*(H17-H18<L18-L17)*(L17<L18))
+22.35*((H18-H19)*(H18-H19>L19-L18)*(H18>H19) - (L19-L18)*(H18-H19<L19-L18)*(L18<L19))
+20.75*((H19-H20)*(H19-H20>L20-L19)*(H19>H20) - (L20-L19)*(H19-H20<L20-L19)*(L19<L20))
+19.27*((H20-H21)*(H20-H21>L21-L20)*(H20>H21) - (L21-L20)*(H20-H21<L21-L20)*(L20<L21))
+17.9*((H21-H22)*(H21-H22>L22-L21)*(H21>H22) - (L22-L21)*(H21-H22<L22-L21)*(L21<L22))
+16.62*((H22-H23)*(H22-H23>L23-L22)*(H22>H23) - (L23-L22)*(H22-H23<L23-L22)*(L22<L23))
+15.43*((H23-H24)*(H23-H24>L24-L23)*(H23>H24) - (L24-L23)*(H23-H24<L24-L23)*(L23<L24))
+14.33*((H24-H25)*(H24-H25>L25-L24)*(H24>H25) - (L25-L24)*(H24-H25<L25-L24)*(L24<L25))
+13.3*((H25-H26)*(H25-H26>L26-L25)*(H25>H26) - (L26-L25)*(H25-H26<L26-L25)*(L25<L26))
+12.35*((H26-H27)*(H26-H27>L27-L26)*(H26>H27) - (L27-L26)*(H26-H27<L27-L26)*(L26<L27))
+11.47*((H27-H28)*(H27-H28>L28-L27)*(H27>H28) - (L28-L27)*(H27-H28<L28-L27)*(L27<L28))
+10.65*((H28-H29)*(H28-H29>L29-L28)*(H28>H29) - (L29-L28)*(H28-H29<L29-L28)*(L28<L29))
+9.89*((H29-H30)*(H29-H30>L30-L29)*(H29>H30) - (L30-L29)*(H29-H30<L30-L29)*(L29<L30))
+9.18*((H30-H31)*(H30-H31>L31-L30)*(H30>H31) - (L31-L30)*(H30-H31<L31-L30)*(L30<L31))
+8.53*((H31-H32)*(H31-H32>L32-L31)*(H31>H32) - (L32-L31)*(H31-H32<L32-L31)*(L31<L32))
+7.92*((H32-H33)*(H32-H33>L33-L32)*(H32>H33) - (L33-L32)*(H32-H33<L33-L32)*(L32<L33))
)

Tanstaafl
Posted : Wednesday, December 15, 2004 7:35:09 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Here's still another simplification ... very clean, and optimizes the use of internal TC capabilities. It's based on the clause for the first-bar in the SGN formula above.

Plot the following DM-difference as a Custom Indicator:
(H0-H1)*(H0-H1>L1-L0)*(H0>H1) - (L1-L0)*(H0-H1<L1-L0)*(L0<L1)

Now apply the exponential equivalent of Wilders's smoothing to it, as a part of the CI definition:
Exponential Pds = (Wilder Pds * 2) -1 = 14*2 - 1
= 27-day exponential smoothing.

Be sure to check "center zero line" when you plot it.

The resulting plotted line calculates virtually instantaneously (compared to all the other stuff, above).

Any time this line CROSSES ZERO, that's a place where the +DI and -DI lines had a crossover.

If this line is GREATER than zero, there is a BULLISH Directional Movement condition (i.e. the posDI line is above the negDI line), and vice versa for Bearish.

IMHO, this is probably the "final" form necessary, since it provides an exceptionally clean, perfectly accurate, and very fast solution.

Please note two applications that are natural uses of it:
1) SortBy Value and flag for >0 or <0
2) Rewrite for some fixed daysago for backtesting

Jim Dean


Tanstaafl
Posted : Friday, December 17, 2004 11:06:55 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Also note that Wilder (the creator of ADX/DMI) strongly recommends the use of the "Extreme Point Rule" (XPR) when you use DI-crosses to signal entry-setup conditions.

The rule is pretty simple ... here it is:

Enter Long on a day subsequent to the day that the posDI crosses up through the negDI, if the posDI is still on top, and if the Close has exceeded the High of the day that the DI's crossed.

Enter Short on a day subsequent to the day that the negDI crosses up through the posDI, if the negDI is still on top, and if the Close is below the Low of the day that the DI's crossed.

RATIONALE: sometimes the DI-crossings are due to onetime spikes in the extremes. This requires confirmation. Those spikes set "resistance" levels ... if the Close goes beyond them, you've got a better likelihood that it's a good trade.

NOTE that sometimes the XPR might not be satisfied till SEVERAL DAYS after the DI-cross. Be sure that the DI's are still stacked properly, and that the ADX still indicates a trend is in place.

drkenrich
Posted : Sunday, July 10, 2005 1:11:34 AM
Registered User
Joined: 3/1/2005
Posts: 31
Tanstaal (Jim),

Everytime I see your handle I feel great about reading the detail. I have advanced degrees but never really found comfort in either math or programming. You are great!

I read with great interest all your permutations to the ADX. I used the final simple plot and it works OK but not quite for what I'm looking for. I've tried to modify the graph lines based on the suggestions herein, but I can't seem to get what I'd like. After getting the custom indicator plot to show, I checked for the relative positions of the + DMI and -DMI and found that the ADX, true to form, shows the difference between them only and which one is on top. However, it didn't do quite what I needed.

One strategy I use is looking for a low +DMI which is below the -DMI and beginning to turn up. The one thing I'd like to see is how to write a pcf to only compute the +DMI and another for the -DMI. With those I could run an initial sort for a low +DMI, but where I want to do this is in an EasyScan. That requires it being in a pcf, not a custom indicator.

Currently, one small work around I find helpful is to make the smoothing factor >100 days. This gives me a quick visual of relatively flat DMIs along with their relative positions. I simply do the chart sort by indicator, then find the region where the values are just about the number I'm looking for. I flag and remove those on the side I don't want (above or below).
I've added a Linear Regression for 40 days and one for 5 days. I use these to sort and find the last two months flat comparisons and the most recent change (upward 5 day). By sorting and removing based on the LRs I find I can get closer to fewer charts than by visually scanning them all. One thing I can't do is find those with a +DMI of less than 10 which is what I'm looking for. The ADX just doesn't give it.

If there is a way to modify your work to accomplish this, I'd truly be grateful.

Thanks,
Dr. Ken Rich
Bruce_L
Posted : Sunday, July 10, 2005 7:59:24 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
drkenrich,
I'll copy and paste them out into their own posts if you want, but Tanstaafl explains how to obtain the formulas for +DMI, -DMI, +DI and -DI in his Thursday, December 09, 2004 4:23:03 PM post that starts this topic.

+DMI:
Go to Tanstaafl's more optimized Monday, December 13, 2004 8:27:28 PM post. The +DMI runs from the start of the formula until, but not including, the visual break created by the lone ">" sign.

-DMI:
Staying in the same post and formula, the -DMI is the block between, but not including, the visual breaks created by the lone ">" sign and the lone "and".

+DI:
Substitute the +DMI formula from above and the ATR (labeled Wilder's TrueRange today) from the original Thursday, December 09, 2004 4:23:03 PM post into the following (the parenthesis are necessary):

100*(+DMI)/(ATR)

-DI:
Do the same, except use the -DMI:

100*(-DMI)/(ATR)

Since you are looking for a +DMI that is starting to turn up, you may be interested in yesterday’s +DMI and –DMI as well.

Yesterday’s +DMI:
It is the block between, but not including, the visual breaks created by the lone "and" and the lone "<" sign.

Yesterday’s –DMI:
It is the block running from, but not including, the lone "<" sign to the end of the formula.

While longer than what would be obtained doing the above, +DI and -DI formulas are also available in the following topic:

PCFs for ADX's +DI and -DI

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Tanstaafl
Posted : Monday, July 11, 2005 10:56:11 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
In response to Dr.Ken's request for DI's that are testable against actual threshold values, here are the two +DI and -DI formulae, with a much higher accuracy than shown in the original posting (it was 10% there, but these are within 1% error) ...

PLEASE NOTE ... these formula take a long time to calculate ... do NOT try to use them as Custom Indicators ... they are suitable for PCF application, however.

Enjoy!

Jim Dean

Positive DI(14):

( 7.2105*(H0-H1)*(H0-H1>L1-L0)*(H0>H1) +6.6955*(H1-H2)*(H1-H2>L2-L1)*(H1>H2) +6.2172*(H2-H3)*(H2-H3>L3-L2)*(H2>H3) +5.7731*(H3-H4)*(H3-H4>L4-L3)*(H3>H4) +5.3608*(H4-H5)*(H4-H5>L5-L4)*(H4>H5) +4.9779*(H5-H6)*(H5-H6>L6-L5)*(H5>H6) +4.6223*(H6-H7)*(H6-H7>L7-L6)*(H6>H7) +4.2921*(H7-H8)*(H7-H8>L8-L7)*(H7>H8) +3.9856*(H8-H9)*(H8-H9>L9-L8)*(H8>H9) +3.7009*(H9-H10)*(H9-H10>L10-L9)*(H9>H10) +3.4365*(H10-H11)*(H10-H11>L11-L10)*(H10>H11) +3.1911*(H11-H12)*(H11-H12>L12-L11)*(H11>H12) +2.9631*(H12-H13)*(H12-H13>L13-L12)*(H12>H13) +2.7515*(H13-H14)*(H13-H14>L14-L13)*(H13>H14) +2.5549*(H14-H15)*(H14-H15>L15-L14)*(H14>H15) +2.3724*(H15-H16)*(H15-H16>L16-L15)*(H15>H16) +2.203*(H16-H17)*(H16-H17>L17-L16)*(H16>H17) +2.0456*(H17-H18)*(H17-H18>L18-L17)*(H17>H18) +1.8995*(H18-H19)*(H18-H19>L19-L18)*(H18>H19) +1.7638*(H19-H20)*(H19-H20>L20-L19)*(H19>H20) +1.6378*(H20-H21)*(H20-H21>L21-L20)*(H20>H21) +1.5209*(H21-H22)*(H21-H22>L22-L21)*(H21>H22) +1.4122*(H22-H23)*(H22-H23>L23-L22)*(H22>H23) +1.3114*(H23-H24)*(H23-H24>L24-L23)*(H23>H24) +1.2177*(H24-H25)*(H24-H25>L25-L24)*(H24>H25) +1.1307*(H25-H26)*(H25-H26>L26-L25)*(H25>H26) +1.0499*(H26-H27)*(H26-H27>L27-L26)*(H26>H27) +.9749*(H27-H28)*(H27-H28>L28-L27)*(H27>H28) +.9053*(H28-H29)*(H28-H29>L29-L28)*(H28>H29) +.8406*(H29-H30)*(H29-H30>L30-L29)*(H29>H30) +.7806*(H30-H31)*(H30-H31>L31-L30)*(H30>H31) +.7248*(H31-H32)*(H31-H32>L32-L31)*(H31>H32) +.6731*(H32-H33)*(H32-H33>L33-L32)*(H32>H33) +.625*(H33-H34)*(H33-H34>L34-L33)*(H33>H34) +.5803*(H34-H35)*(H34-H35>L35-L34)*(H34>H35) +.5389*(H35-H36)*(H35-H36>L36-L35)*(H35>H36) +.5004*(H36-H37)*(H36-H37>L37-L36)*(H36>H37) +.4647*(H37-H38)*(H37-H38>L38-L37)*(H37>H38) +.4315*(H38-H39)*(H38-H39>L39-L38)*(H38>H39) +.4006*(H39-H40)*(H39-H40>L40-L39)*(H39>H40) +.372*(H40-H41)*(H40-H41>L41-L40)*(H40>H41) +.3455*(H41-H42)*(H41-H42>L42-L41)*(H41>H42) +.3208*(H42-H43)*(H42-H43>L43-L42)*(H42>H43) +.2979*(H43-H44)*(H43-H44>L44-L43)*(H43>H44) +.2766*(H44-H45)*(H44-H45>L45-L44)*(H44>H45) +.2568*(H45-H46)*(H45-H46>L46-L45)*(H45>H46) +.2385*(H46-H47)*(H46-H47>L47-L46)*(H46>H47) +.2215*(H47-H48)*(H47-H48>L48-L47)*(H47>H48) +.2056*(H48-H49)*(H48-H49>L49-L48)*(H48>H49) +.1909*(H49-H50)*(H49-H50>L50-L49)*(H49>H50) +.1773*(H50-H51)*(H50-H51>L51-L50)*(H50>H51) +.1646*(H51-H52)*(H51-H52>L52-L51)*(H51>H52) +.1529*(H52-H53)*(H52-H53>L53-L52)*(H52>H53) +.142*(H53-H54)*(H53-H54>L54-L53)*(H53>H54) +.1318*(H54-H55)*(H54-H55>L55-L54)*(H54>H55) +.1224*(H55-H56)*(H55-H56>L56-L55)*(H55>H56) +.1137*(H56-H57)*(H56-H57>L57-L56)*(H56>H57) +.1055*(H57-H58)*(H57-H58>L58-L57)*(H57>H58) +.098*(H58-H59)*(H58-H59>L59-L58)*(H58>H59) +.091*(H59-H60)*(H59-H60>L60-L59)*(H59>H60) +.0845*(H60-H61)*(H60-H61>L61-L60)*(H60>H61) +.0785*(H61-H62)*(H61-H62>L62-L61)*(H61>H62) +.0729*(H62-H63)*(H62-H63>L63-L62)*(H62>H63) ) / (( 7.2105*(H0-L0+Abs(H0-C1)+Abs(L0-C1)) +6.6955*(H1-L1+Abs(H1-C2)+Abs(L1-C2)) +6.2172*(H2-L2+Abs(H2-C3)+Abs(L2-C3)) +5.7731*(H3-L3+Abs(H3-C4)+Abs(L3-C4)) +5.3608*(H4-L4+Abs(H4-C5)+Abs(L4-C5)) +4.9779*(H5-L5+Abs(H5-C6)+Abs(L5-C6)) +4.6223*(H6-L6+Abs(H6-C7)+Abs(L6-C7)) +4.2921*(H7-L7+Abs(H7-C8)+Abs(L7-C8)) +3.9856*(H8-L8+Abs(H8-C9)+Abs(L8-C9)) +3.7009*(H9-L9+Abs(H9-C10)+Abs(L9-C10)) +3.4365*(H10-L10+Abs(H10-C11)+Abs(L10-C11)) +3.1911*(H11-L11+Abs(H11-C12)+Abs(L11-C12)) +2.9631*(H12-L12+Abs(H12-C13)+Abs(L12-C13)) +2.7515*(H13-L13+Abs(H13-C14)+Abs(L13-C14)) +2.5549*(H14-L14+Abs(H14-C15)+Abs(L14-C15)) +2.3724*(H15-L15+Abs(H15-C16)+Abs(L15-C16)) +2.203*(H16-L16+Abs(H16-C17)+Abs(L16-C17)) +2.0456*(H17-L17+Abs(H17-C18)+Abs(L17-C18)) +1.8995*(H18-L18+Abs(H18-C19)+Abs(L18-C19)) +1.7638*(H19-L19+Abs(H19-C20)+Abs(L19-C20)) +1.6378*(H20-L20+Abs(H20-C21)+Abs(L20-C21)) +1.5209*(H21-L21+Abs(H21-C22)+Abs(L21-C22)) +1.4122*(H22-L22+Abs(H22-C23)+Abs(L22-C23)) +1.3114*(H23-L23+Abs(H23-C24)+Abs(L23-C24)) +1.2177*(H24-L24+Abs(H24-C25)+Abs(L24-C25)) +1.1307*(H25-L25+Abs(H25-C26)+Abs(L25-C26)) +1.0499*(H26-L26+Abs(H26-C27)+Abs(L26-C27)) +.9749*(H27-L27+Abs(H27-C28)+Abs(L27-C28)) +.9053*(H28-L28+Abs(H28-C29)+Abs(L28-C29)) +.8406*(H29-L29+Abs(H29-C30)+Abs(L29-C30)) +.7806*(H30-L30+Abs(H30-C31)+Abs(L30-C31)) +.7248*(H31-L31+Abs(H31-C32)+Abs(L31-C32)) +.6731*(H32-L32+Abs(H32-C33)+Abs(L32-C33)) +.625*(H33-L33+Abs(H33-C34)+Abs(L33-C34)) +.5803*(H34-L34+Abs(H34-C35)+Abs(L34-C35)) +.5389*(H35-L35+Abs(H35-C36)+Abs(L35-C36)) +.5004*(H36-L36+Abs(H36-C37)+Abs(L36-C37)) +.4647*(H37-L37+Abs(H37-C38)+Abs(L37-C38)) +.4315*(H38-L38+Abs(H38-C39)+Abs(L38-C39)) +.4006*(H39-L39+Abs(H39-C40)+Abs(L39-C40)) +.372*(H40-L40+Abs(H40-C41)+Abs(L40-C41)) +.3455*(H41-L41+Abs(H41-C42)+Abs(L41-C42)) +.3208*(H42-L42+Abs(H42-C43)+Abs(L42-C43)) +.2979*(H43-L43+Abs(H43-C44)+Abs(L43-C44)) +.2766*(H44-L44+Abs(H44-C45)+Abs(L44-C45)) +.2568*(H45-L45+Abs(H45-C46)+Abs(L45-C46)) +.2385*(H46-L46+Abs(H46-C47)+Abs(L46-C47)) +.2215*(H47-L47+Abs(H47-C48)+Abs(L47-C48)) +.2056*(H48-L48+Abs(H48-C49)+Abs(L48-C49)) +.1909*(H49-L49+Abs(H49-C50)+Abs(L49-C50)) +.1773*(H50-L50+Abs(H50-C51)+Abs(L50-C51)) +.1646*(H51-L51+Abs(H51-C52)+Abs(L51-C52)) +.1529*(H52-L52+Abs(H52-C53)+Abs(L52-C53)) +.142*(H53-L53+Abs(H53-C54)+Abs(L53-C54)) +.1318*(H54-L54+Abs(H54-C55)+Abs(L54-C55)) +.1224*(H55-L55+Abs(H55-C56)+Abs(L55-C56)) +.1137*(H56-L56+Abs(H56-C57)+Abs(L56-C57)) +.1055*(H57-L57+Abs(H57-C58)+Abs(L57-C58)) +.098*(H58-L58+Abs(H58-C59)+Abs(L58-C59)) +.091*(H59-L59+Abs(H59-C60)+Abs(L59-C60)) +.0845*(H60-L60+Abs(H60-C61)+Abs(L60-C61)) +.0785*(H61-L61+Abs(H61-C62)+Abs(L61-C62)) +.0729*(H62-L62+Abs(H62-C63)+Abs(L62-C63)) ) / 2 )

Negative DI(14):

( 7.2105*(L1-L0)*(H0-H1<L1-L0)*(L0<L1) +6.6955*(L2-L1)*(H1-H2<L2-L1)*(L1<L2) +6.2172*(L3-L2)*(H2-H3<L3-L2)*(L2<L3) +5.7731*(L4-L3)*(H3-H4<L4-L3)*(L3<L4) +5.3608*(L5-L4)*(H4-H5<L5-L4)*(L4<L5) +4.9779*(L6-L5)*(H5-H6<L6-L5)*(L5<L6) +4.6223*(L7-L6)*(H6-H7<L7-L6)*(L6<L7) +4.2921*(L8-L7)*(H7-H8<L8-L7)*(L7<L8) +3.9856*(L9-L8)*(H8-H9<L9-L8)*(L8<L9) +3.7009*(L10-L9)*(H9-H10<L10-L9)*(L9<L10) +3.4365*(L11-L10)*(H10-H11<L11-L10)*(L10<L11) +3.1911*(L12-L11)*(H11-H12<L12-L11)*(L11<L12) +2.9631*(L13-L12)*(H12-H13<L13-L12)*(L12<L13) +2.7515*(L14-L13)*(H13-H14<L14-L13)*(L13<L14) +2.5549*(L15-L14)*(H14-H15<L15-L14)*(L14<L15) +2.3724*(L16-L15)*(H15-H16<L16-L15)*(L15<L16) +2.203*(L17-L16)*(H16-H17<L17-L16)*(L16<L17) +2.0456*(L18-L17)*(H17-H18<L18-L17)*(L17<L18) +1.8995*(L19-L18)*(H18-H19<L19-L18)*(L18<L19) +1.7638*(L20-L19)*(H19-H20<L20-L19)*(L19<L20) +1.6378*(L21-L20)*(H20-H21<L21-L20)*(L20<L21) +1.5209*(L22-L21)*(H21-H22<L22-L21)*(L21<L22) +1.4122*(L23-L22)*(H22-H23<L23-L22)*(L22<L23) +1.3114*(L24-L23)*(H23-H24<L24-L23)*(L23<L24) +1.2177*(L25-L24)*(H24-H25<L25-L24)*(L24<L25) +1.1307*(L26-L25)*(H25-H26<L26-L25)*(L25<L26) +1.0499*(L27-L26)*(H26-H27<L27-L26)*(L26<L27) +.9749*(L28-L27)*(H27-H28<L28-L27)*(L27<L28) +.9053*(L29-L28)*(H28-H29<L29-L28)*(L28<L29) +.8406*(L30-L29)*(H29-H30<L30-L29)*(L29<L30) +.7806*(L31-L30)*(H30-H31<L31-L30)*(L30<L31) +.7248*(L32-L31)*(H31-H32<L32-L31)*(L31<L32) +.6731*(L33-L32)*(H32-H33<L33-L32)*(L32<L33) +.625*(L34-L33)*(H33-H34<L34-L33)*(L33<L34) +.5803*(L35-L34)*(H34-H35<L35-L34)*(L34<L35) +.5389*(L36-L35)*(H35-H36<L36-L35)*(L35<L36) +.5004*(L37-L36)*(H36-H37<L37-L36)*(L36<L37) +.4647*(L38-L37)*(H37-H38<L38-L37)*(L37<L38) +.4315*(L39-L38)*(H38-H39<L39-L38)*(L38<L39) +.4006*(L40-L39)*(H39-H40<L40-L39)*(L39<L40) +.372*(L41-L40)*(H40-H41<L41-L40)*(L40<L41) +.3455*(L42-L41)*(H41-H42<L42-L41)*(L41<L42) +.3208*(L43-L42)*(H42-H43<L43-L42)*(L42<L43) +.2979*(L44-L43)*(H43-H44<L44-L43)*(L43<L44) +.2766*(L45-L44)*(H44-H45<L45-L44)*(L44<L45) +.2568*(L46-L45)*(H45-H46<L46-L45)*(L45<L46) +.2385*(L47-L46)*(H46-H47<L47-L46)*(L46<L47) +.2215*(L48-L47)*(H47-H48<L48-L47)*(L47<L48) +.2056*(L49-L48)*(H48-H49<L49-L48)*(L48<L49) +.1909*(L50-L49)*(H49-H50<L50-L49)*(L49<L50) +.1773*(L51-L50)*(H50-H51<L51-L50)*(L50<L51) +.1646*(L52-L51)*(H51-H52<L52-L51)*(L51<L52) +.1529*(L53-L52)*(H52-H53<L53-L52)*(L52<L53) +.142*(L54-L53)*(H53-H54<L54-L53)*(L53<L54) +.1318*(L55-L54)*(H54-H55<L55-L54)*(L54<L55) +.1224*(L56-L55)*(H55-H56<L56-L55)*(L55<L56) +.1137*(L57-L56)*(H56-H57<L57-L56)*(L56<L57) +.1055*(L58-L57)*(H57-H58<L58-L57)*(L57<L58) +.098*(L59-L58)*(H58-H59<L59-L58)*(L58<L59) +.091*(L60-L59)*(H59-H60<L60-L59)*(L59<L60) +.0845*(L61-L60)*(H60-H61<L61-L60)*(L60<L61) +.0785*(L62-L61)*(H61-H62<L62-L61)*(L61<L62) +.0729*(L63-L62)*(H62-H63<L63-L62)*(L62<L63) ) / (( 7.2105*(H0-L0+Abs(H0-C1)+Abs(L0-C1)) +6.6955*(H1-L1+Abs(H1-C2)+Abs(L1-C2)) +6.2172*(H2-L2+Abs(H2-C3)+Abs(L2-C3)) +5.7731*(H3-L3+Abs(H3-C4)+Abs(L3-C4)) +5.3608*(H4-L4+Abs(H4-C5)+Abs(L4-C5)) +4.9779*(H5-L5+Abs(H5-C6)+Abs(L5-C6)) +4.6223*(H6-L6+Abs(H6-C7)+Abs(L6-C7)) +4.2921*(H7-L7+Abs(H7-C8)+Abs(L7-C8)) +3.9856*(H8-L8+Abs(H8-C9)+Abs(L8-C9)) +3.7009*(H9-L9+Abs(H9-C10)+Abs(L9-C10)) +3.4365*(H10-L10+Abs(H10-C11)+Abs(L10-C11)) +3.1911*(H11-L11+Abs(H11-C12)+Abs(L11-C12)) +2.9631*(H12-L12+Abs(H12-C13)+Abs(L12-C13)) +2.7515*(H13-L13+Abs(H13-C14)+Abs(L13-C14)) +2.5549*(H14-L14+Abs(H14-C15)+Abs(L14-C15)) +2.3724*(H15-L15+Abs(H15-C16)+Abs(L15-C16)) +2.203*(H16-L16+Abs(H16-C17)+Abs(L16-C17)) +2.0456*(H17-L17+Abs(H17-C18)+Abs(L17-C18)) +1.8995*(H18-L18+Abs(H18-C19)+Abs(L18-C19)) +1.7638*(H19-L19+Abs(H19-C20)+Abs(L19-C20)) +1.6378*(H20-L20+Abs(H20-C21)+Abs(L20-C21)) +1.5209*(H21-L21+Abs(H21-C22)+Abs(L21-C22)) +1.4122*(H22-L22+Abs(H22-C23)+Abs(L22-C23)) +1.3114*(H23-L23+Abs(H23-C24)+Abs(L23-C24)) +1.2177*(H24-L24+Abs(H24-C25)+Abs(L24-C25)) +1.1307*(H25-L25+Abs(H25-C26)+Abs(L25-C26)) +1.0499*(H26-L26+Abs(H26-C27)+Abs(L26-C27)) +.9749*(H27-L27+Abs(H27-C28)+Abs(L27-C28)) +.9053*(H28-L28+Abs(H28-C29)+Abs(L28-C29)) +.8406*(H29-L29+Abs(H29-C30)+Abs(L29-C30)) +.7806*(H30-L30+Abs(H30-C31)+Abs(L30-C31)) +.7248*(H31-L31+Abs(H31-C32)+Abs(L31-C32)) +.6731*(H32-L32+Abs(H32-C33)+Abs(L32-C33)) +.625*(H33-L33+Abs(H33-C34)+Abs(L33-C34)) +.5803*(H34-L34+Abs(H34-C35)+Abs(L34-C35)) +.5389*(H35-L35+Abs(H35-C36)+Abs(L35-C36)) +.5004*(H36-L36+Abs(H36-C37)+Abs(L36-C37)) +.4647*(H37-L37+Abs(H37-C38)+Abs(L37-C38)) +.4315*(H38-L38+Abs(H38-C39)+Abs(L38-C39)) +.4006*(H39-L39+Abs(H39-C40)+Abs(L39-C40)) +.372*(H40-L40+Abs(H40-C41)+Abs(L40-C41)) +.3455*(H41-L41+Abs(H41-C42)+Abs(L41-C42)) +.3208*(H42-L42+Abs(H42-C43)+Abs(L42-C43)) +.2979*(H43-L43+Abs(H43-C44)+Abs(L43-C44)) +.2766*(H44-L44+Abs(H44-C45)+Abs(L44-C45)) +.2568*(H45-L45+Abs(H45-C46)+Abs(L45-C46)) +.2385*(H46-L46+Abs(H46-C47)+Abs(L46-C47)) +.2215*(H47-L47+Abs(H47-C48)+Abs(L47-C48)) +.2056*(H48-L48+Abs(H48-C49)+Abs(L48-C49)) +.1909*(H49-L49+Abs(H49-C50)+Abs(L49-C50)) +.1773*(H50-L50+Abs(H50-C51)+Abs(L50-C51)) +.1646*(H51-L51+Abs(H51-C52)+Abs(L51-C52)) +.1529*(H52-L52+Abs(H52-C53)+Abs(L52-C53)) +.142*(H53-L53+Abs(H53-C54)+Abs(L53-C54)) +.1318*(H54-L54+Abs(H54-C55)+Abs(L54-C55)) +.1224*(H55-L55+Abs(H55-C56)+Abs(L55-C56)) +.1137*(H56-L56+Abs(H56-C57)+Abs(L56-C57)) +.1055*(H57-L57+Abs(H57-C58)+Abs(L57-C58)) +.098*(H58-L58+Abs(H58-C59)+Abs(L58-C59)) +.091*(H59-L59+Abs(H59-C60)+Abs(L59-C60)) +.0845*(H60-L60+Abs(H60-C61)+Abs(L60-C61)) +.0785*(H61-L61+Abs(H61-C62)+Abs(L61-C62)) +.0729*(H62-L62+Abs(H62-C63)+Abs(L62-C63)) ) / 2 )

drkenrich
Posted : Thursday, July 14, 2005 1:34:55 AM
Registered User
Joined: 3/1/2005
Posts: 31
Bruce & Jim,

I can't thank you enough. What you've given me is awesome, to say the least. Once I could get the +DMI I was able to manipulate it to my desired end. I would suggest you and others try it on a few charts to see what you get.

I took Bruce's comment on using the Monday, December 13, 2004 8:27:28 PM post. I cut and pasted it directly into a custom indicator that I than set with an Exponential 20 smoothing average. Once it was plotted I then created a Moving Average fot the plot at 100 bars.

The original plan was to try to find a way to scan for very low +DMI that had stayed low for 3 months or more. In the past, when I've found them, I set them in a watch list until I saw it break out upward crossing the -DMI stongly. At that point I enter going long and have had a very high (>90%) success rate with it. The problem has always been trying to find such patterns without having to eyeball each and every chart.

With what you've given me, I think it's even better. Over several hundred charts I've now examined with it, setting the charts to Daily bars and viewing 6+ months at a time, I now have one of the best crossover indicators I've seen in a long time.

Believe me, try it, you'll like it. I sincerely thank you both for your help.

Dr. Ken Rich
dwayne
Posted : Saturday, December 3, 2005 7:26:17 PM
Registered User
Joined: 10/7/2004
Posts: 165
i am trying to achieve the crossover system "drkenrich" talks about in his july 14, 2005 1:34:55 am post. i emailed him, but he never got back to me.
can you please tell me what i am doing wrong....
i cut and pasted the post by "tanstaafl" on dec.13,2004 8:27:28 pm and put it into a custom indicator and tested it and got the error "the formula must not return a boolean value for a formula indicator"
what did i do wrong?
thanks.
Tanstaafl
Posted : Sunday, December 4, 2005 9:20:11 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
that formula must be plotted as a "percent true" custom indicator ... but it will be VERY sluggish

Jim Dean

dwayne
Posted : Sunday, December 4, 2005 4:19:09 PM
Registered User
Joined: 10/7/2004
Posts: 165
thanks. i changed it to % true and it works, but, like you said, it is very slow.
you may have already answered my next question, but how do i use it the way drkenrich speaks of in his 7/14/05 post? he must be doing something to make it move faster????
thanks for your help.
Tanstaafl
Posted : Tuesday, December 6, 2005 4:38:44 PM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Best solution is to get a copy of TC-Companion ... it has the ADX and the DMI's as true internal functions. You can write PCF's (inside TCC) with them. TCC uses TC's data feed, and links pretty tightly with TC. It provides a robust backtesting environment as well.

Jim Dean

Tanstaafl
Posted : Tuesday, December 6, 2005 4:39:34 PM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
The only way to speed it up is to minimize the number of bars on the screen at once ... use Zoom 9.



dwayne
Posted : Wednesday, December 7, 2005 11:23:05 PM
Registered User
Joined: 10/7/2004
Posts: 165
how/where do i get a copy of tc-companion? i am unfamiliar with this product.
do you know if the worden trainers will help me write the pcf's within tcc?
in the mean time, i will use zoom 9.
thanks for your time.
Craig_S
Posted : Thursday, December 8, 2005 6:06:55 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
TC-Companion is a third-party product not produced by Worden.

It is available here:

TC Companion Home Page

We can always help you with PCFs that are using the limits of TeleChart. Support for other products must be sought from them.

- Craig
Here to Help!
dwayne
Posted : Thursday, December 8, 2005 10:47:58 PM
Registered User
Joined: 10/7/2004
Posts: 165
thanks.
cspunar
Posted : Tuesday, January 24, 2006 12:35:56 PM
Registered User
Joined: 8/15/2005
Posts: 1
I've incorporated these ideas to simplify this:

The key is that I'm looking for (+DM) - (-DM) that is very close to Zero.

So I take my DM for a given day; its either + or -. If its - I keep the sign negative. Multiply it by its weighting factor. And then add that value to the sum.

As for as the weighting factors: since we have the difference of two infinite sums, I just subtract the A0 term from the A1 term to get my difference between days.

So I'm actually calculating the change in DM. To give it some perspective, I divide it by an approximation of Wilder's true range, XAVGH14-XAVGL14 (this ignores gaps but serves the purpose of eliminating stocks that are trading in a 0.25 point band).

Then with this method I just scan for stocks that are + or - .05 of zero. A word of warning. It should match deadnutz with Wilder's 14 14 DI lines, and most of the time the DI lines are crossing or are within a couple days of crossing. But sometimes it looks like a big miss, however if I look back at price I can always identify the beginnings of a potential trend change.

Anyhow here is my formula, let me know what you think or if you have any improvements. Oh the error is minimized because I add back in the last term with the full multiplier. I'm not a math guy but it makes sense because it balances the terms.

(
0.0866773148027758*( ( (H34-H35)>(L35-L34)) * (H34>H35) * (H34-H35) - ( ( (L35-L34)>(H34-H35) ) * (L34<L35) * (L35-L34) ) ) +
0.00666748575405968*( ( (H33-H34)>(L34-L33)) * (H33>H34) * (H33-H34) - ( ( (L34-L33)>(H33-H34) ) * (L33<L34) * (L34-L33) ) ) +
0.00718036927360273*( ( (H32-H33)>(L33-L32)) * (H32>H33) * (H32-H33) - ( ( (L33-L32)>(H32-H33) ) * (L32<L33) * (L33-L32) ) ) +
0.00773270537157217*( ( (H31-H32)>(L32-L31)) * (H31>H32) * (H31-H32) - ( ( (L32-L31)>(H31-H32) ) * (L31<L32) * (L32-L31) ) ) +
0.00832752886169311*( ( (H30-H31)>(L31-L30)) * (H30>H31) * (H30-H31) - ( ( (L31-L30)>(H30-H31) ) * (L30<L31) * (L31-L30) ) ) +
0.00896810800490026*( ( (H29-H30)>(L30-L29)) * (H29>H30) * (H29-H30) - ( ( (L30-L29)>(H29-H30) ) * (L29<L30) * (L30-L29) ) ) +
0.00965796246681566*( ( (H28-H29)>(L29-L28)) * (H28>H29) * (H28-H29) - ( ( (L29-L28)>(H28-H29) ) * (L28<L29) * (L29-L28) ) ) +
0.0104008826565707*( ( (H27-H28)>(L28-L27)) * (H27>H28) * (H27-H28) - ( ( (L28-L27)>(H27-H28) ) * (L27<L28) * (L28-L27) ) ) +
0.01120095055323*( ( (H26-H27)>(L27-L26)) * (H26>H27) * (H26-H27) - ( ( (L27-L26)>(H26-H27) ) * (L26<L27) * (L27-L26) ) ) +
0.0120625621342477*( ( (H25-H26)>(L26-L25)) * (H25>H26) * (H25-H26) - ( ( (L26-L25)>(H25-H26) ) * (L25<L26) * (L26-L25) ) ) +
0.0129904515291898*( ( (H24-H25)>(L25-L24)) * (H24>H25) * (H24-H25) - ( ( (L25-L24)>(H24-H25) ) * (L24<L25) * (L25-L24) ) ) +
0.0139897170314352*( ( (H23-H24)>(L24-L23)) * (H23>H24) * (H23-H24) - ( ( (L24-L23)>(H23-H24) ) * (L23<L24) * (L24-L23) ) ) +
0.0150658491107764*( ( (H22-H23)>(L23-L22)) * (H22>H23) * (H22-H23) - ( ( (L23-L22)>(H22-H23) ) * (L22<L23) * (L23-L22) ) ) +
0.0162247605808361*( ( (H21-H22)>(L22-L21)) * (H21>H22) * (H21-H22) - ( ( (L22-L21)>(H21-H22) ) * (L21<L22) * (L22-L21) ) ) +
0.0174728190870543*( ( (H20-H21)>(L21-L20)) * (H20>H21) * (H20-H21) - ( ( (L21-L20)>(H20-H21) ) * (L20<L21) * (L21-L20) ) ) +
0.0188168820937507*( ( (H19-H20)>(L20-L19)) * (H19>H20) * (H19-H20) - ( ( (L20-L19)>(H19-H20) ) * (L19<L20) * (L20-L19) ) ) +
0.0202643345625008*( ( (H18-H19)>(L19-L18)) * (H18>H19) * (H18-H19) - ( ( (L19-L18)>(H18-H19) ) * (L18<L19) * (L19-L18) ) ) +
0.021823129528847*( ( (H17-H18)>(L18-L17)) * (H17>H18) * (H17-H18) - ( ( (L18-L17)>(H17-H18) ) * (L17<L18) * (L18-L17) ) ) +
0.0235018318002967*( ( (H16-H17)>(L17-L16)) * (H16>H17) * (H16-H17) - ( ( (L17-L16)>(H16-H17) ) * (L16<L17) * (L17-L16) ) ) +
0.0253096650157042*( ( (H15-H16)>(L16-L15)) * (H15>H16) * (H15-H16) - ( ( (L16-L15)>(H15-H16) ) * (L15<L16) * (L16-L15) ) ) +
0.0272565623246045*( ( (H14-H15)>(L15-L14)) * (H14>H15) * (H14-H15) - ( ( (L15-L14)>(H14-H15) ) * (L14<L15) * (L15-L14) ) ) +
0.0293532209649587*( ( (H13-H14)>(L14-L13)) * (H13>H14) * (H13-H14) - ( ( (L14-L13)>(H13-H14) ) * (L13<L14) * (L14-L13) ) ) +
0.0316111610391863*( ( (H12-H13)>(L13-L12)) * (H12>H13) * (H12-H13) - ( ( (L13-L12)>(H12-H13) ) * (L12<L13) * (L13-L12) ) ) +
0.0340427888114314*( ( (H11-H12)>(L12-L11)) * (H11>H12) * (H11-H12) - ( ( (L12-L11)>(H11-H12) ) * (L11<L12) * (L12-L11) ) ) +
0.0366614648738492*( ( (H10-H11)>(L11-L10)) * (H10>H11) * (H10-H11) - ( ( (L11-L10)>(H10-H11) ) * (L10<L11) * (L11-L10) ) ) +
0.039481577556453*( ( (H9-H10)>(L10-L9)) * (H9>H10) * (H9-H10) - ( ( (L10-L9)>(H9-H10) ) * (L9<L10) * (L10-L9) ) ) +
0.0425186219838725*( ( (H8-H9)>(L9-L8)) * (H8>H9) * (H8-H9) - ( ( (L9-L8)>(H8-H9) ) * (L8<L9) * (L9-L8) ) ) +
0.0457892852134011*( ( (H7-H8)>(L8-L7)) * (H7>H8) * (H7-H8) - ( ( (L8-L7)>(H7-H8) ) * (L7<L8) * (L8-L7) ) ) +
0.0493115379221243*( ( (H6-H7)>(L7-L6)) * (H6>H7) * (H6-H7) - ( ( (L7-L6)>(H6-H7) ) * (L6<L7) * (L7-L6) ) ) +
0.0531047331469031*( ( (H5-H6)>(L6-L5)) * (H5>H6) * (H5-H6) - ( ( (L6-L5)>(H5-H6) ) * (L5<L6) * (L6-L5) ) ) +
0.0571897126197417*( ( (H4-H5)>(L5-L4)) * (H4>H5) * (H4-H5) - ( ( (L5-L4)>(H4-H5) ) * (L4<L5) * (L5-L4) ) ) +
0.0615889212827988*( ( (H3-H4)>(L4-L3)) * (H3>H4) * (H3-H4) - ( ( (L4-L3)>(H3-H4) ) * (L3<L4) * (L4-L3) ) ) +
0.0663265306122449*( ( (H2-H3)>(L3-L2)) * (H2>H3) * (H2-H3) - ( ( (L3-L2)>(H2-H3) ) * (L2<L3) * (L3-L2) ) ) +
0.0714285714285714*( ( (H1-H2)>(L2-L1)) * (H1>H2) * (H1-H2) - ( ( (L2-L1)>(H1-H2) ) * (L1<L2) * (L2-L1) ) ) -
1*( ( (H-H1)>(L1-L)) * (H>H1) * (H-H1) - ( ( (L1-L)>(H-H1) ) * (L<L1) * (L1-L) ) )
) * (-1)*0.0714285714285714*100 / (XAVGH14-XAVGL14)
ewoelbel
Posted : Tuesday, July 25, 2006 4:02:49 PM
Gold Customer Gold Customer

Joined: 3/28/2005
Posts: 39
thanks
odinali
Posted : Thursday, February 28, 2008 2:45:39 PM
Registered User
Joined: 2/19/2008
Posts: 3
Hello,

This is great stuff but I want to use -DI and +DI with a 10 period not a 14 period. What would be the new weight factors be and how were those weight factors calculated any way. Also I would like to calculate the 10 period ADX. I know I could graph these values in TC2007 but I want to scan based on these values and eventhough I could sort by the ADX I can't check for -DI and +DI crossovers natively.

I could figure out the rest if I could understand how the weight factors were calculated. Could some kind soul explain to me?

Thanks for the help.
Odin
Bruce_L
Posted : Thursday, February 28, 2008 3:28:46 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
odinali,
Welcome to the forums. A very good foundation for learning how to use TeleChart can be gained by reviewing the following:

If you are new to TeleChart READ THIS FIRST!

I do not know of a practical method for creating a Personal Criteria Formula for the actual ADX value. All of my attempts have been to long and slow to be practical.

Warning: Long Personal Criteria Formulas can dramatically increase the time it takes to update your PCFs.

One way to write the formula for the current (+DMI10)-(-DMI10) would be:

.100095591785708 * ((H - H1) * (H - H1 > L1 - L) * (H > H1) - (L1 - L) * (H - H1 < L1 - L) * (L < L1) + .9 * ((H1 - H2) * (H1 - H2 > L2 - L1) * (H1 > H2) - (L2 - L1) * (H1 - H2 < L2 - L1) * (L1 < L2) + .9 * ((H2 - H3) * (H2 - H3 > L3 - L2) * (H2 > H3) - (L3 - L2) * (H2 - H3 < L3 - L2) * (L2 < L3) + .9 * ((H3 - H4) * (H3 - H4 > L4 - L3) * (H3 > H4) - (L4 - L3) * (H3 - H4 < L4 - L3) * (L3 < L4) + .9 * ((H4 - H5) * (H4 - H5 > L5 - L4) * (H4 > H5) - (L5 - L4) * (H4 - H5 < L5 - L4) * (L4 < L5) + .9 * ((H5 - H6) * (H5 - H6 > L6 - L5) * (H5 > H6) - (L6 - L5) * (H5 - H6 < L6 - L5) * (L5 < L6) + .9 * ((H6 - H7) * (H6 - H7 > L7 - L6) * (H6 > H7) - (L7 - L6) * (H6 - H7 < L7 - L6) * (L6 < L7) + .9 * ((H7 - H8) * (H7 - H8 > L8 - L7) * (H7 > H8) - (L8 - L7) * (H7 - H8 < L8 - L7) * (L7 < L8) + .9 * ((H8 - H9) * (H8 - H9 > L9 - L8) * (H8 > H9) - (L9 - L8) * (H8 - H9 < L9 - L8) * (L8 < L9) + .9 * ((H9 - H10) * (H9 - H10 > L10 - L9) * (H9 > H10) - (L10 - L9) * (H9 - H10 < L10 - L9) * (L9 < L10) + .9 * ((H10 - H11) * (H10 - H11 > L11 - L10) * (H10 > H11) - (L11 - L10) * (H10 - H11 < L11 - L10) * (L10 < L11) + .9 * ((H11 - H12) * (H11 - H12 > L12 - L11) * (H11 > H12) - (L12 - L11) * (H11 - H12 < L12 - L11) * (L11 < L12) + .9 * ((H12 - H13) * (H12 - H13 > L13 - L12) * (H12 > H13) - (L13 - L12) * (H12 - H13 < L13 - L12) * (L12 < L13) + .9 * ((H13 - H14) * (H13 - H14 > L14 - L13) * (H13 > H14) - (L14 - L13) * (H13 - H14 < L14 - L13) * (L13 < L14) + .9 * ((H14 - H15) * (H14 - H15 > L15 - L14) * (H14 > H15) - (L15 - L14) * (H14 - H15 < L15 - L14) * (L14 < L15) + .9 * ((H15 - H16) * (H15 - H16 > L16 - L15) * (H15 > H16) - (L16 - L15) * (H15 - H16 < L16 - L15) * (L15 < L16) + .9 * ((H16 - H17) * (H16 - H17 > L17 - L16) * (H16 > H17) - (L17 - L16) * (H16 - H17 < L17 - L16) * (L16 < L17) + .9 * ((H17 - H18) * (H17 - H18 > L18 - L17) * (H17 > H18) - (L18 - L17) * (H17 - H18 < L18 - L17) * (L17 < L18) + .9 * ((H18 - H19) * (H18 - H19 > L19 - L18) * (H18 > H19) - (L19 - L18) * (H18 - H19 < L19 - L18) * (L18 < L19) + .9 * ((H19 - H20) * (H19 - H20 > L20 - L19) * (H19 > H20) - (L20 - L19) * (H19 - H20 < L20 - L19) * (L19 < L20) + .9 * ((H20 - H21) * (H20 - H21 > L21 - L20) * (H20 > H21) - (L21 - L20) * (H20 - H21 < L21 - L20) * (L20 < L21) + .9 * ((H21 - H22) * (H21 - H22 > L22 - L21) * (H21 > H22) - (L22 - L21) * (H21 - H22 < L22 - L21) * (L21 < L22) + .9 * ((H22 - H23) * (H22 - H23 > L23 - L22) * (H22 > H23) - (L23 - L22) * (H22 - H23 < L23 - L22) * (L22 < L23) + .9 * ((H23 - H24) * (H23 - H24 > L24 - L23) * (H23 > H24) - (L24 - L23) * (H23 - H24 < L24 - L23) * (L23 < L24) + .9 * ((H24 - H25) * (H24 - H25 > L25 - L24) * (H24 > H25) - (L25 - L24) * (H24 - H25 < L25 - L24) * (L24 < L25) + .9 * ((H25 - H26) * (H25 - H26 > L26 - L25) * (H25 > H26) - (L26 - L25) * (H25 - H26 < L26 - L25) * (L25 < L26) + .9 * ((H26 - H27) * (H26 - H27 > L27 - L26) * (H26 > H27) - (L27 - L26) * (H26 - H27 < L27 - L26) * (L26 < L27) + .9 * ((H27 - H28) * (H27 - H28 > L28 - L27) * (H27 > H28) - (L28 - L27) * (H27 - H28 < L28 - L27) * (L27 < L28) + .9 * ((H28 - H29) * (H28 - H29 > L29 - L28) * (H28 > H29) - (L29 - L28) * (H28 - H29 < L29 - L28) * (L28 < L29) + .9 * ((H29 - H30) * (H29 - H30 > L30 - L29) * (H29 > H30) - (L30 - L29) * (H29 - H30 < L30 - L29) * (L29 < L30) + .9 * ((H30 - H31) * (H30 - H31 > L31 - L30) * (H30 > H31) - (L31 - L30) * (H30 - H31 < L31 - L30) * (L30 < L31) + .9 * ((H31 - H32) * (H31 - H32 > L32 - L31) * (H31 > H32) - (L32 - L31) * (H31 - H32 < L32 - L31) * (L31 < L32) + .9 * ((H32 - H33) * (H32 - H33 > L33 - L32) * (H32 > H33) - (L33 - L32) * (H32 - H33 < L33 - L32) * (L32 < L33) + .9 * ((H33 - H34) * (H33 - H34 > L34 - L33) * (H33 > H34) - (L34 - L33) * (H33 - H34 < L34 - L33) * (L33 < L34) + .9 * ((H34 - H35) * (H34 - H35 > L35 - L34) * (H34 > H35) - (L35 - L34) * (H34 - H35 < L35 - L34) * (L34 < L35) + .9 * ((H35 - H36) * (H35 - H36 > L36 - L35) * (H35 > H36) - (L36 - L35) * (H35 - H36 < L36 - L35) * (L35 < L36) + .9 * ((H36 - H37) * (H36 - H37 > L37 - L36) * (H36 > H37) - (L37 - L36) * (H36 - H37 < L37 - L36) * (L36 < L37) + .9 * ((H37 - H38) * (H37 - H38 > L38 - L37) * (H37 > H38) - (L38 - L37) * (H37 - H38 < L38 - L37) * (L37 < L38) + .9 * ((H38 - H39) * (H38 - H39 > L39 - L38) * (H38 > H39) - (L39 - L38) * (H38 - H39 < L39 - L38) * (L38 < L39) + .9 * ((H39 - H40) * (H39 - H40 > L40 - L39) * (H39 > H40) - (L40 - L39) * (H39 - H40 < L40 - L39) * (L39 < L40) + .9 * ((H40 - H41) * (H40 - H41 > L41 - L40) * (H40 > H41) - (L41 - L40) * (H40 - H41 < L41 - L40) * (L40 < L41) + .9 * ((H41 - H42) * (H41 - H42 > L42 - L41) * (H41 > H42) - (L42 - L41) * (H41 - H42 < L42 - L41) * (L41 < L42) + .9 * ((H42 - H43) * (H42 - H43 > L43 - L42) * (H42 > H43) - (L43 - L42) * (H42 - H43 < L43 - L42) * (L42 < L43) + .9 * ((H43 - H44) * (H43 - H44 > L44 - L43) * (H43 > H44) - (L44 - L43) * (H43 - H44 < L44 - L43) * (L43 < L44) + .9 * ((H44 - H45) * (H44 - H45 > L45 - L44) * (H44 > H45) - (L45 - L44) * (H44 - H45 < L45 - L44) * (L44 < L45) + .9 * ((H45 - H46) * (H45 - H46 > L46 - L45) * (H45 > H46) - (L46 - L45) * (H45 - H46 < L46 - L45) * (L45 < L46) + .9 * ((H46 - H47) * (H46 - H47 > L47 - L46) * (H46 > H47) - (L47 - L46) * (H46 - H47 < L47 - L46) * (L46 < L47) + .9 * ((H47 - H48) * (H47 - H48 > L48 - L47) * (H47 > H48) - (L48 - L47) * (H47 - H48 < L48 - L47) * (L47 < L48) + .9 * ((H48 - H49) * (H48 - H49 > L49 - L48) * (H48 > H49) - (L49 - L48) * (H48 - H49 < L49 - L48) * (L48 < L49) + .9 * ((H49 - H50) * (H49 - H50 > L50 - L49) * (H49 > H50) - (L50 - L49) * (H49 - H50 < L50 - L49) * (L49 < L50) + .9 * ((H50 - H51) * (H50 - H51 > L51 - L50) * (H50 > H51) - (L51 - L50) * (H50 - H51 < L51 - L50) * (L50 < L51) + .9 * ((H51 - H52) * (H51 - H52 > L52 - L51) * (H51 > H52) - (L52 - L51) * (H51 - H52 < L52 - L51) * (L51 < L52) + .9 * ((H52 - H53) * (H52 - H53 > L53 - L52) * (H52 > H53) - (L53 - L52) * (H52 - H53 < L53 - L52) * (L52 < L53) + .9 * ((H53 - H54) * (H53 - H54 > L54 - L53) * (H53 > H54) - (L54 - L53) * (H53 - H54 < L54 - L53) * (L53 < L54) + .9 * ((H54 - H55) * (H54 - H55 > L55 - L54) * (H54 > H55) - (L55 - L54) * (H54 - H55 < L55 - L54) * (L54 < L55) + .9 * ((H55 - H56) * (H55 - H56 > L56 - L55) * (H55 > H56) - (L56 - L55) * (H55 - H56 < L56 - L55) * (L55 < L56) + .9 * ((H56 - H57) * (H56 - H57 > L57 - L56) * (H56 > H57) - (L57 - L56) * (H56 - H57 < L57 - L56) * (L56 < L57) + .9 * ((H57 - H58) * (H57 - H58 > L58 - L57) * (H57 > H58) - (L58 - L57) * (H57 - H58 < L58 - L57) * (L57 < L58) + .9 * ((H58 - H59) * (H58 - H59 > L59 - L58) * (H58 > H59) - (L59 - L58) * (H58 - H59 < L59 - L58) * (L58 < L59) + .9 * ((H59 - H60) * (H59 - H60 > L60 - L59) * (H59 > H60) - (L60 - L59) * (H59 - H60 < L60 - L59) * (L59 < L60) + .9 * ((H60 - H61) * (H60 - H61 > L61 - L60) * (H60 > H61) - (L61 - L60) * (H60 - H61 < L61 - L60) * (L60 < L61) + .9 * ((H61 - H62) * (H61 - H62 > L62 - L61) * (H61 > H62) - (L62 - L61) * (H61 - H62 < L62 - L61) * (L61 < L62) + .9 * ((H62 - H63) * (H62 - H63 > L63 - L62) * (H62 > H63) - (L63 - L62) * (H62 - H63 < L63 - L62) * (L62 < L63) + .9 * ((H63 - H64) * (H63 - H64 > L64 - L63) * (H63 > H64) - (L64 - L63) * (H63 - H64 < L64 - L63) * (L63 < L64) + .9 * ((H64 - H65) * (H64 - H65 > L65 - L64) * (H64 > H65) - (L65 - L64) * (H64 - H65 < L65 - L64) * (L64 < L65) + .9 * ((H65 - H66) * (H65 - H66 > L66 - L65) * (H65 > H66) - (L66 - L65) * (H65 - H66 < L66 - L65) * (L65 < L66)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

Crossovers require calculating the previous value as well:

.100095591785708 * ((H1 - H2) * (H1 - H2 > L2 - L1) * (H1 > H2) - (L2 - L1) * (H1 - H2 < L2 - L1) * (L1 < L2) + .9 * ((H2 - H3) * (H2 - H3 > L3 - L2) * (H2 > H3) - (L3 - L2) * (H2 - H3 < L3 - L2) * (L2 < L3) + .9 * ((H3 - H4) * (H3 - H4 > L4 - L3) * (H3 > H4) - (L4 - L3) * (H3 - H4 < L4 - L3) * (L3 < L4) + .9 * ((H4 - H5) * (H4 - H5 > L5 - L4) * (H4 > H5) - (L5 - L4) * (H4 - H5 < L5 - L4) * (L4 < L5) + .9 * ((H5 - H6) * (H5 - H6 > L6 - L5) * (H5 > H6) - (L6 - L5) * (H5 - H6 < L6 - L5) * (L5 < L6) + .9 * ((H6 - H7) * (H6 - H7 > L7 - L6) * (H6 > H7) - (L7 - L6) * (H6 - H7 < L7 - L6) * (L6 < L7) + .9 * ((H7 - H8) * (H7 - H8 > L8 - L7) * (H7 > H8) - (L8 - L7) * (H7 - H8 < L8 - L7) * (L7 < L8) + .9 * ((H8 - H9) * (H8 - H9 > L9 - L8) * (H8 > H9) - (L9 - L8) * (H8 - H9 < L9 - L8) * (L8 < L9) + .9 * ((H9 - H10) * (H9 - H10 > L10 - L9) * (H9 > H10) - (L10 - L9) * (H9 - H10 < L10 - L9) * (L9 < L10) + .9 * ((H10 - H11) * (H10 - H11 > L11 - L10) * (H10 > H11) - (L11 - L10) * (H10 - H11 < L11 - L10) * (L10 < L11) + .9 * ((H11 - H12) * (H11 - H12 > L12 - L11) * (H11 > H12) - (L12 - L11) * (H11 - H12 < L12 - L11) * (L11 < L12) + .9 * ((H12 - H13) * (H12 - H13 > L13 - L12) * (H12 > H13) - (L13 - L12) * (H12 - H13 < L13 - L12) * (L12 < L13) + .9 * ((H13 - H14) * (H13 - H14 > L14 - L13) * (H13 > H14) - (L14 - L13) * (H13 - H14 < L14 - L13) * (L13 < L14) + .9 * ((H14 - H15) * (H14 - H15 > L15 - L14) * (H14 > H15) - (L15 - L14) * (H14 - H15 < L15 - L14) * (L14 < L15) + .9 * ((H15 - H16) * (H15 - H16 > L16 - L15) * (H15 > H16) - (L16 - L15) * (H15 - H16 < L16 - L15) * (L15 < L16) + .9 * ((H16 - H17) * (H16 - H17 > L17 - L16) * (H16 > H17) - (L17 - L16) * (H16 - H17 < L17 - L16) * (L16 < L17) + .9 * ((H17 - H18) * (H17 - H18 > L18 - L17) * (H17 > H18) - (L18 - L17) * (H17 - H18 < L18 - L17) * (L17 < L18) + .9 * ((H18 - H19) * (H18 - H19 > L19 - L18) * (H18 > H19) - (L19 - L18) * (H18 - H19 < L19 - L18) * (L18 < L19) + .9 * ((H19 - H20) * (H19 - H20 > L20 - L19) * (H19 > H20) - (L20 - L19) * (H19 - H20 < L20 - L19) * (L19 < L20) + .9 * ((H20 - H21) * (H20 - H21 > L21 - L20) * (H20 > H21) - (L21 - L20) * (H20 - H21 < L21 - L20) * (L20 < L21) + .9 * ((H21 - H22) * (H21 - H22 > L22 - L21) * (H21 > H22) - (L22 - L21) * (H21 - H22 < L22 - L21) * (L21 < L22) + .9 * ((H22 - H23) * (H22 - H23 > L23 - L22) * (H22 > H23) - (L23 - L22) * (H22 - H23 < L23 - L22) * (L22 < L23) + .9 * ((H23 - H24) * (H23 - H24 > L24 - L23) * (H23 > H24) - (L24 - L23) * (H23 - H24 < L24 - L23) * (L23 < L24) + .9 * ((H24 - H25) * (H24 - H25 > L25 - L24) * (H24 > H25) - (L25 - L24) * (H24 - H25 < L25 - L24) * (L24 < L25) + .9 * ((H25 - H26) * (H25 - H26 > L26 - L25) * (H25 > H26) - (L26 - L25) * (H25 - H26 < L26 - L25) * (L25 < L26) + .9 * ((H26 - H27) * (H26 - H27 > L27 - L26) * (H26 > H27) - (L27 - L26) * (H26 - H27 < L27 - L26) * (L26 < L27) + .9 * ((H27 - H28) * (H27 - H28 > L28 - L27) * (H27 > H28) - (L28 - L27) * (H27 - H28 < L28 - L27) * (L27 < L28) + .9 * ((H28 - H29) * (H28 - H29 > L29 - L28) * (H28 > H29) - (L29 - L28) * (H28 - H29 < L29 - L28) * (L28 < L29) + .9 * ((H29 - H30) * (H29 - H30 > L30 - L29) * (H29 > H30) - (L30 - L29) * (H29 - H30 < L30 - L29) * (L29 < L30) + .9 * ((H30 - H31) * (H30 - H31 > L31 - L30) * (H30 > H31) - (L31 - L30) * (H30 - H31 < L31 - L30) * (L30 < L31) + .9 * ((H31 - H32) * (H31 - H32 > L32 - L31) * (H31 > H32) - (L32 - L31) * (H31 - H32 < L32 - L31) * (L31 < L32) + .9 * ((H32 - H33) * (H32 - H33 > L33 - L32) * (H32 > H33) - (L33 - L32) * (H32 - H33 < L33 - L32) * (L32 < L33) + .9 * ((H33 - H34) * (H33 - H34 > L34 - L33) * (H33 > H34) - (L34 - L33) * (H33 - H34 < L34 - L33) * (L33 < L34) + .9 * ((H34 - H35) * (H34 - H35 > L35 - L34) * (H34 > H35) - (L35 - L34) * (H34 - H35 < L35 - L34) * (L34 < L35) + .9 * ((H35 - H36) * (H35 - H36 > L36 - L35) * (H35 > H36) - (L36 - L35) * (H35 - H36 < L36 - L35) * (L35 < L36) + .9 * ((H36 - H37) * (H36 - H37 > L37 - L36) * (H36 > H37) - (L37 - L36) * (H36 - H37 < L37 - L36) * (L36 < L37) + .9 * ((H37 - H38) * (H37 - H38 > L38 - L37) * (H37 > H38) - (L38 - L37) * (H37 - H38 < L38 - L37) * (L37 < L38) + .9 * ((H38 - H39) * (H38 - H39 > L39 - L38) * (H38 > H39) - (L39 - L38) * (H38 - H39 < L39 - L38) * (L38 < L39) + .9 * ((H39 - H40) * (H39 - H40 > L40 - L39) * (H39 > H40) - (L40 - L39) * (H39 - H40 < L40 - L39) * (L39 < L40) + .9 * ((H40 - H41) * (H40 - H41 > L41 - L40) * (H40 > H41) - (L41 - L40) * (H40 - H41 < L41 - L40) * (L40 < L41) + .9 * ((H41 - H42) * (H41 - H42 > L42 - L41) * (H41 > H42) - (L42 - L41) * (H41 - H42 < L42 - L41) * (L41 < L42) + .9 * ((H42 - H43) * (H42 - H43 > L43 - L42) * (H42 > H43) - (L43 - L42) * (H42 - H43 < L43 - L42) * (L42 < L43) + .9 * ((H43 - H44) * (H43 - H44 > L44 - L43) * (H43 > H44) - (L44 - L43) * (H43 - H44 < L44 - L43) * (L43 < L44) + .9 * ((H44 - H45) * (H44 - H45 > L45 - L44) * (H44 > H45) - (L45 - L44) * (H44 - H45 < L45 - L44) * (L44 < L45) + .9 * ((H45 - H46) * (H45 - H46 > L46 - L45) * (H45 > H46) - (L46 - L45) * (H45 - H46 < L46 - L45) * (L45 < L46) + .9 * ((H46 - H47) * (H46 - H47 > L47 - L46) * (H46 > H47) - (L47 - L46) * (H46 - H47 < L47 - L46) * (L46 < L47) + .9 * ((H47 - H48) * (H47 - H48 > L48 - L47) * (H47 > H48) - (L48 - L47) * (H47 - H48 < L48 - L47) * (L47 < L48) + .9 * ((H48 - H49) * (H48 - H49 > L49 - L48) * (H48 > H49) - (L49 - L48) * (H48 - H49 < L49 - L48) * (L48 < L49) + .9 * ((H49 - H50) * (H49 - H50 > L50 - L49) * (H49 > H50) - (L50 - L49) * (H49 - H50 < L50 - L49) * (L49 < L50) + .9 * ((H50 - H51) * (H50 - H51 > L51 - L50) * (H50 > H51) - (L51 - L50) * (H50 - H51 < L51 - L50) * (L50 < L51) + .9 * ((H51 - H52) * (H51 - H52 > L52 - L51) * (H51 > H52) - (L52 - L51) * (H51 - H52 < L52 - L51) * (L51 < L52) + .9 * ((H52 - H53) * (H52 - H53 > L53 - L52) * (H52 > H53) - (L53 - L52) * (H52 - H53 < L53 - L52) * (L52 < L53) + .9 * ((H53 - H54) * (H53 - H54 > L54 - L53) * (H53 > H54) - (L54 - L53) * (H53 - H54 < L54 - L53) * (L53 < L54) + .9 * ((H54 - H55) * (H54 - H55 > L55 - L54) * (H54 > H55) - (L55 - L54) * (H54 - H55 < L55 - L54) * (L54 < L55) + .9 * ((H55 - H56) * (H55 - H56 > L56 - L55) * (H55 > H56) - (L56 - L55) * (H55 - H56 < L56 - L55) * (L55 < L56) + .9 * ((H56 - H57) * (H56 - H57 > L57 - L56) * (H56 > H57) - (L57 - L56) * (H56 - H57 < L57 - L56) * (L56 < L57) + .9 * ((H57 - H58) * (H57 - H58 > L58 - L57) * (H57 > H58) - (L58 - L57) * (H57 - H58 < L58 - L57) * (L57 < L58) + .9 * ((H58 - H59) * (H58 - H59 > L59 - L58) * (H58 > H59) - (L59 - L58) * (H58 - H59 < L59 - L58) * (L58 < L59) + .9 * ((H59 - H60) * (H59 - H60 > L60 - L59) * (H59 > H60) - (L60 - L59) * (H59 - H60 < L60 - L59) * (L59 < L60) + .9 * ((H60 - H61) * (H60 - H61 > L61 - L60) * (H60 > H61) - (L61 - L60) * (H60 - H61 < L61 - L60) * (L60 < L61) + .9 * ((H61 - H62) * (H61 - H62 > L62 - L61) * (H61 > H62) - (L62 - L61) * (H61 - H62 < L62 - L61) * (L61 < L62) + .9 * ((H62 - H63) * (H62 - H63 > L63 - L62) * (H62 > H63) - (L63 - L62) * (H62 - H63 < L63 - L62) * (L62 < L63) + .9 * ((H63 - H64) * (H63 - H64 > L64 - L63) * (H63 > H64) - (L64 - L63) * (H63 - H64 < L64 - L63) * (L63 < L64) + .9 * ((H64 - H65) * (H64 - H65 > L65 - L64) * (H64 > H65) - (L65 - L64) * (H64 - H65 < L65 - L64) * (L64 < L65) + .9 * ((H65 - H66) * (H65 - H66 > L66 - L65) * (H65 > H66) - (L66 - L65) * (H65 - H66 < L66 - L65) * (L65 < L66) + .9 * ((H66 - H67) * (H66 - H67 > L67 - L66) * (H66 > H67) - (L67 - L66) * (H66 - H67 < L67 - L66) * (L66 < L67)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

If P is the Wilders Smoothing Period, the most recent Value of whatever is being Smoothed is given a weight of 1/P (in this case, .1). This initial weight is reduced by a factor of 1-(1/P) for each additional included term (in this case .9).

You have probably already noticed that the first term is not actually .1. This is because it is adjusted for unity by a factor equal to 1/(sum of all weights).

While they might appear different, the calculated weights used in the earlier formulas in the topic end up being the same as the weights calculated using the nested parentheses method used in the formulas provided in this post. The difference is just that in one case the weights are pre-calculated and in the other they are calculated by the formula. While it might seem that calculating these weights in advance would speed up formula calculation, the nested versions actually appear to calculate more quickly when tested.

You may wish to review Cascades of Moving Averages for more details on these types of expansions.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
odinali
Posted : Thursday, February 28, 2008 5:00:35 PM
Registered User
Joined: 2/19/2008
Posts: 3
Thanks for the quick reply.

Just to be clear all I want to check is if the +DI is above the -DI. I don't want to know if they crossed today. Just if one is above the other.

So therefore if I say if your first block of code before the visual break is > 0 then the +DI > -DI and if the code is < 0 then the +DI < - DI.

Am I correct?
Bruce_L
Posted : Friday, February 29, 2008 7:16:51 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
odinali,
You are correct.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
diceman
Posted : Friday, February 29, 2008 8:53:00 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
"Now apply the exponential equivalent of Wilders's smoothing to it, as a part of the CI definition:
Exponential Pds = (Wilder Pds * 2) -1 = 14*2 - 1
= 27-day exponential smoothing."
-----------------------------------------------------------------
 
 
I've seen Wilders smoothing described as:
 
 
C*(1/N)+((N-1)/N)*P
 
where:
 
 
C=Close
P= the previous Wilders exponential
moving average value.
N= the number of periods in the average.
 
Does anyone know
Is this the same in a different form?
 
(I haven't worked thru the numbers yet. I had forgotten the
three times the period minus one and had nothing to
check it against)
 
 
This is from New Trends in Technical Analysis. 
 
 
Thanks
diceman
 
Bruce_L
Posted : Friday, February 29, 2008 9:24:25 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
diceman,
Let's do the math:

Wilder's Smoothing:

C*(1/W)+((W-1)/W)*P

Standard Exponential Smoothing:

C*(2/(E+1))+((E-1)/(E+1))*P

Where:

C = Close
P = Previous Smoothed Value
W= Wilder's Period
E = Standard EMA Period

We know:

1/N + (N-1)/N = 1

And:

2/(E+1) + (E-1)/(E+1) = 1

We want:

C*(1/W)+((W-1)/W)*P = C*(2/(E+1))+((E-1)/(E+1))*P

So:

1/W = 2/(E+1)
1=2*W/(E+1)
E+1=2*W
E=2*W-1

And:

(W-1)/W = (E-1)/(E+1)
W-1=W*(E-1)/(E+1)
(W-1)*(E+1)=W*(E-1)
W*E+W-E-1=W*E-W
W-E-1=-W
2*W=E+1
W=(E+1)/2

Now you might say, "But you solved the C and P portions independently instead of the entire formula at once." That's OK in this case and it was simpler. The C portions and P portions of the formula must be the same in this case if the functions actually do the same thing. In addition, you'll note that the second to last step in each process results in the same formula (just with the sides reversed).

So yes, it is just a different way to write the same thing.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
diceman
Posted : Friday, February 29, 2008 9:29:48 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
Thanks
Bruce
Bruce_L
Posted : Friday, February 29, 2008 9:41:20 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
diceman,
You're welcome. Our pleasure.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
odinali
Posted : Friday, February 29, 2008 4:41:19 PM
Registered User
Joined: 2/19/2008
Posts: 3
Thanks for the help. Works like a charm and does not slow down TC.

Odin
Bruce_L
Posted : Friday, February 29, 2008 5:13:45 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
odinali,
You're welcome. Our pleasure.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jfh123
Posted : Friday, May 16, 2008 7:49:47 PM
Registered User
Joined: 12/17/2004
Posts: 143
Jim,

What everyone has written here seems sufficiently doable (just has lots of characters), but ... I'm not doing well when I try to figure it out.  I want crossovers of +DI and -DI, but only for 5pds, not 14.  If you'd show me the solution for 2 or 3 pds, I think i could get to 5 myself.

QUOTE (Tanstaafl)
Here's still another simplification ... very clean, and optimizes the use of internal TC capabilities. It's based on the clause for the first-bar in the SGN formula above.

Plot the following DM-difference as a Custom Indicator:
(H0-H1)*(H0-H1>L1-L0)*(H0>H1) - (L1-L0)*(H0-H1<L1-L0)*(L0<L1)

Now apply the exponential equivalent of Wilders's smoothing to it, as a part of the CI definition:
Exponential Pds = (Wilder Pds * 2) -1 = 14*2 - 1
= 27-day exponential smoothing.

Be sure to check "center zero line" when you plot it.

The resulting plotted line calculates virtually instantaneously (compared to all the other stuff, above).

Any time this line CROSSES ZERO, that's a place where the +DI and -DI lines had a crossover.

If this line is GREATER than zero, there is a BULLISH Directional Movement condition (i.e. the posDI line is above the negDI line), and vice versa for Bearish.

IMHO, this is probably the "final" form necessary, since it provides an exceptionally clean, perfectly accurate, and very fast solution.

Please note two applications that are natural uses of it:
1) SortBy Value and flag for >0 or <0
2) Rewrite for some fixed daysago for backtesting

Jim Dean
Bruce_L
Posted : Thursday, May 22, 2008 8:03:56 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
jfh123,
Please try the following for a 2-Period DMI crossover:

Select Chart Template | Add Indicator | Indicator.
- Visible: Checked
- Center Zero Line: Checked
- Plot using price scale: Unchecked
- Smoothing Average: 3
- Average Type: Exponential
- Indicator Formula: (H -H1) * (H - H1 > L1 - L) * (H > H1) - (L1 - L) * (H - H1 < L1 - L) * (L < L1)

You would also need to create a Custom Indicator for yesterday:

Select Chart Template | Add Indicator | Indicator.
- Visible: Checked
- Center Zero Line: Checked
- Plot using price scale: Unchecked
- Smoothing Average: 3
- Average Type: Exponential
- Indicator Formula: (H1 -H2) * (H1 - H2 > L2 - L1) * (H1 > H2) - (L2 - L1) * (H1 - H2 < L2 - L1) * (L1 < L2)

You are looking for one of these to be above zero while the other is below zero to find a crossover. Note that the Smoothing Average is 3 for a 2-Period ADX. It would be 5 for a 3-Period ADX or 9 for a 5-Period ADX. You may wish to review the following:

Plotting Custom Indicators with Examples
How to use the Flagging feature

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jfh123
Posted : Thursday, May 22, 2008 10:29:08 AM
Registered User
Joined: 12/17/2004
Posts: 143

B-

Thanks for your reply.  Can you help me put this in a PCF, instead?

J

Bruce_L
Posted : Thursday, May 22, 2008 10:37:24 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
jfh123,
Please try one or more of the following:

5-Period +DI xUp -DI:

.200198266760174 * ((H - H1) * (H - H1 > L1 - L) * (H > H1) - (L1 - L) * (H - H1 < L1 - L) * (L < L1) + .8 * ((H1 - H2) * (H1 - H2 > L2 - L1) * (H1 > H2) - (L2 - L1) * (H1 - H2 < L2 - L1) * (L1 < L2) + .8 * ((H2 - H3) * (H2 - H3 > L3 - L2) * (H2 > H3) - (L3 - L2) * (H2 - H3 < L3 - L2) * (L2 < L3) + .8 * ((H3 - H4) * (H3 - H4 > L4 - L3) * (H3 > H4) - (L4 - L3) * (H3 - H4 < L4 - L3) * (L3 < L4) + .8 * ((H4 - H5) * (H4 - H5 > L5 - L4) * (H4 > H5) - (L5 - L4) * (H4 - H5 < L5 - L4) * (L4 < L5) + .8 * ((H5 - H6) * (H5 - H6 > L6 - L5) * (H5 > H6) - (L6 - L5) * (H5 - H6 < L6 - L5) * (L5 < L6) + .8 * ((H6 - H7) * (H6 - H7 > L7 - L6) * (H6 > H7) - (L7 - L6) * (H6 - H7 < L7 - L6) * (L6 < L7) + .8 * ((H7 - H8) * (H7 - H8 > L8 - L7) * (H7 > H8) - (L8 - L7) * (H7 - H8 < L8 - L7) * (L7 < L8) + .8 * ((H8 - H9) * (H8 - H9 > L9 - L8) * (H8 > H9) - (L9 - L8) * (H8 - H9 < L9 - L8) * (L8 < L9) + .8 * ((H9 - H10) * (H9 - H10 > L10 - L9) * (H9 > H10) - (L10 - L9) * (H9 - H10 < L10 - L9) * (L9 < L10) + .8 * ((H10 - H11) * (H10 - H11 > L11 - L10) * (H10 > H11) - (L11 - L10) * (H10 - H11 < L11 - L10) * (L10 < L11) + .8 * ((H11 - H12) * (H11 - H12 > L12 - L11) * (H11 > H12) - (L12 - L11) * (H11 - H12 < L12 - L11) * (L11 < L12) + .8 * ((H12 - H13) * (H12 - H13 > L13 - L12) * (H12 > H13) - (L13 - L12) * (H12 - H13 < L13 - L12) * (L12 < L13) + .8 * ((H13 - H14) * (H13 - H14 > L14 - L13) * (H13 > H14) - (L14 - L13) * (H13 - H14 < L14 - L13) * (L13 < L14) + .8 * ((H14 - H15) * (H14 - H15 > L15 - L14) * (H14 > H15) - (L15 - L14) * (H14 - H15 < L15 - L14) * (L14 < L15) + .8 * ((H15 - H16) * (H15 - H16 > L16 - L15) * (H15 > H16) - (L16 - L15) * (H15 - H16 < L16 - L15) * (L15 < L16) + .8 * ((H16 - H17) * (H16 - H17 > L17 - L16) * (H16 > H17) - (L17 - L16) * (H16 - H17 < L17 - L16) * (L16 < L17) + .8 * ((H17 - H18) * (H17 - H18 > L18 - L17) * (H17 > H18) - (L18 - L17) * (H17 - H18 < L18 - L17) * (L17 < L18) + .8 * ((H18 - H19) * (H18 - H19 > L19 - L18) * (H18 > H19) - (L19 - L18) * (H18 - H19 < L19 - L18) * (L18 < L19) + .8 * ((H19 - H20) * (H19 - H20 > L20 - L19) * (H19 > H20) - (L20 - L19) * (H19 - H20 < L20 - L19) * (L19 < L20) + .8 * ((H20 - H21) * (H20 - H21 > L21 - L20) * (H20 > H21) - (L21 - L20) * (H20 - H21 < L21 - L20) * (L20 < L21) + .8 * ((H21 - H22) * (H21 - H22 > L22 - L21) * (H21 > H22) - (L22 - L21) * (H21 - H22 < L22 - L21) * (L21 < L22) + .8 * ((H22 - H23) * (H22 - H23 > L23 - L22) * (H22 > H23) - (L23 - L22) * (H22 - H23 < L23 - L22) * (L22 < L23) + .8 * ((H23 - H24) * (H23 - H24 > L24 - L23) * (H23 > H24) - (L24 - L23) * (H23 - H24 < L24 - L23) * (L23 < L24) + .8 * ((H24 - H25) * (H24 - H25 > L25 - L24) * (H24 > H25) - (L25 - L24) * (H24 - H25 < L25 - L24) * (L24 < L25) + .8 * ((H25 - H26) * (H25 - H26 > L26 - L25) * (H25 > H26) - (L26 - L25) * (H25 - H26 < L26 - L25) * (L25 < L26) + .8 * ((H26 - H27) * (H26 - H27 > L27 - L26) * (H26 > H27) - (L27 - L26) * (H26 - H27 < L27 - L26) * (L26 < L27) + .8 * ((H27 - H28) * (H27 - H28 > L28 - L27) * (H27 > H28) - (L28 - L27) * (H27 - H28 < L28 - L27) * (L27 < L28) + .8 * ((H28 - H29) * (H28 - H29 > L29 - L28) * (H28 > H29) - (L29 - L28) * (H28 - H29 < L29 - L28) * (L28 < L29) + .8 * ((H29 - H30) * (H29 - H30 > L30 - L29) * (H29 > H30) - (L30 - L29) * (H29 - H30 < L30 - L29) * (L29 < L30) + .8 * ((H30 - H31) * (H30 - H31 > L31 - L30) * (H30 > H31) - (L31 - L30) * (H30 - H31 < L31 - L30) * (L30 < L31)))))))))))))))))))))))))))))))) > 0 AND .200198266760174 * ((H1 - H2) * (H1 - H2 > L2 - L1) * (H1 > H2) - (L2 - L1) * (H1 - H2 < L2 - L1) * (L1 < L2) + .8 * ((H2 - H3) * (H2 - H3 > L3 - L2) * (H2 > H3) - (L3 - L2) * (H2 - H3 < L3 - L2) * (L2 < L3) + .8 * ((H3 - H4) * (H3 - H4 > L4 - L3) * (H3 > H4) - (L4 - L3) * (H3 - H4 < L4 - L3) * (L3 < L4) + .8 * ((H4 - H5) * (H4 - H5 > L5 - L4) * (H4 > H5) - (L5 - L4) * (H4 - H5 < L5 - L4) * (L4 < L5) + .8 * ((H5 - H6) * (H5 - H6 > L6 - L5) * (H5 > H6) - (L6 - L5) * (H5 - H6 < L6 - L5) * (L5 < L6) + .8 * ((H6 - H7) * (H6 - H7 > L7 - L6) * (H6 > H7) - (L7 - L6) * (H6 - H7 < L7 - L6) * (L6 < L7) + .8 * ((H7 - H8) * (H7 - H8 > L8 - L7) * (H7 > H8) - (L8 - L7) * (H7 - H8 < L8 - L7) * (L7 < L8) + .8 * ((H8 - H9) * (H8 - H9 > L9 - L8) * (H8 > H9) - (L9 - L8) * (H8 - H9 < L9 - L8) * (L8 < L9) + .8 * ((H9 - H10) * (H9 - H10 > L10 - L9) * (H9 > H10) - (L10 - L9) * (H9 - H10 < L10 - L9) * (L9 < L10) + .8 * ((H10 - H11) * (H10 - H11 > L11 - L10) * (H10 > H11) - (L11 - L10) * (H10 - H11 < L11 - L10) * (L10 < L11) + .8 * ((H11 - H12) * (H11 - H12 > L12 - L11) * (H11 > H12) - (L12 - L11) * (H11 - H12 < L12 - L11) * (L11 < L12) + .8 * ((H12 - H13) * (H12 - H13 > L13 - L12) * (H12 > H13) - (L13 - L12) * (H12 - H13 < L13 - L12) * (L12 < L13) + .8 * ((H13 - H14) * (H13 - H14 > L14 - L13) * (H13 > H14) - (L14 - L13) * (H13 - H14 < L14 - L13) * (L13 < L14) + .8 * ((H14 - H15) * (H14 - H15 > L15 - L14) * (H14 > H15) - (L15 - L14) * (H14 - H15 < L15 - L14) * (L14 < L15) + .8 * ((H15 - H16) * (H15 - H16 > L16 - L15) * (H15 > H16) - (L16 - L15) * (H15 - H16 < L16 - L15) * (L15 < L16) + .8 * ((H16 - H17) * (H16 - H17 > L17 - L16) * (H16 > H17) - (L17 - L16) * (H16 - H17 < L17 - L16) * (L16 < L17) + .8 * ((H17 - H18) * (H17 - H18 > L18 - L17) * (H17 > H18) - (L18 - L17) * (H17 - H18 < L18 - L17) * (L17 < L18) + .8 * ((H18 - H19) * (H18 - H19 > L19 - L18) * (H18 > H19) - (L19 - L18) * (H18 - H19 < L19 - L18) * (L18 < L19) + .8 * ((H19 - H20) * (H19 - H20 > L20 - L19) * (H19 > H20) - (L20 - L19) * (H19 - H20 < L20 - L19) * (L19 < L20) + .8 * ((H20 - H21) * (H20 - H21 > L21 - L20) * (H20 > H21) - (L21 - L20) * (H20 - H21 < L21 - L20) * (L20 < L21) + .8 * ((H21 - H22) * (H21 - H22 > L22 - L21) * (H21 > H22) - (L22 - L21) * (H21 - H22 < L22 - L21) * (L21 < L22) + .8 * ((H22 - H23) * (H22 - H23 > L23 - L22) * (H22 > H23) - (L23 - L22) * (H22 - H23 < L23 - L22) * (L22 < L23) + .8 * ((H23 - H24) * (H23 - H24 > L24 - L23) * (H23 > H24) - (L24 - L23) * (H23 - H24 < L24 - L23) * (L23 < L24) + .8 * ((H24 - H25) * (H24 - H25 > L25 - L24) * (H24 > H25) - (L25 - L24) * (H24 - H25 < L25 - L24) * (L24 < L25) + .8 * ((H25 - H26) * (H25 - H26 > L26 - L25) * (H25 > H26) - (L26 - L25) * (H25 - H26 < L26 - L25) * (L25 < L26) + .8 * ((H26 - H27) * (H26 - H27 > L27 - L26) * (H26 > H27) - (L27 - L26) * (H26 - H27 < L27 - L26) * (L26 < L27) + .8 * ((H27 - H28) * (H27 - H28 > L28 - L27) * (H27 > H28) - (L28 - L27) * (H27 - H28 < L28 - L27) * (L27 < L28) + .8 * ((H28 - H29) * (H28 - H29 > L29 - L28) * (H28 > H29) - (L29 - L28) * (H28 - H29 < L29 - L28) * (L28 < L29) + .8 * ((H29 - H30) * (H29 - H30 > L30 - L29) * (H29 > H30) - (L30 - L29) * (H29 - H30 < L30 - L29) * (L29 < L30) + .8 * ((H30 - H31) * (H30 - H31 > L31 - L30) * (H30 > H31) - (L31 - L30) * (H30 - H31 < L31 - L30) * (L30 < L31) + .8 * ((H31 - H32) * (H31 - H32 > L32 - L31) * (H31 > H32) - (L32 - L31) * (H31 - H32 < L32 - L31) * (L31 < L32)))))))))))))))))))))))))))))))) <= 0

5-Period +DI xDn -DI:

.200198266760174 * ((H - H1) * (H - H1 > L1 - L) * (H > H1) - (L1 - L) * (H - H1 < L1 - L) * (L < L1) + .8 * ((H1 - H2) * (H1 - H2 > L2 - L1) * (H1 > H2) - (L2 - L1) * (H1 - H2 < L2 - L1) * (L1 < L2) + .8 * ((H2 - H3) * (H2 - H3 > L3 - L2) * (H2 > H3) - (L3 - L2) * (H2 - H3 < L3 - L2) * (L2 < L3) + .8 * ((H3 - H4) * (H3 - H4 > L4 - L3) * (H3 > H4) - (L4 - L3) * (H3 - H4 < L4 - L3) * (L3 < L4) + .8 * ((H4 - H5) * (H4 - H5 > L5 - L4) * (H4 > H5) - (L5 - L4) * (H4 - H5 < L5 - L4) * (L4 < L5) + .8 * ((H5 - H6) * (H5 - H6 > L6 - L5) * (H5 > H6) - (L6 - L5) * (H5 - H6 < L6 - L5) * (L5 < L6) + .8 * ((H6 - H7) * (H6 - H7 > L7 - L6) * (H6 > H7) - (L7 - L6) * (H6 - H7 < L7 - L6) * (L6 < L7) + .8 * ((H7 - H8) * (H7 - H8 > L8 - L7) * (H7 > H8) - (L8 - L7) * (H7 - H8 < L8 - L7) * (L7 < L8) + .8 * ((H8 - H9) * (H8 - H9 > L9 - L8) * (H8 > H9) - (L9 - L8) * (H8 - H9 < L9 - L8) * (L8 < L9) + .8 * ((H9 - H10) * (H9 - H10 > L10 - L9) * (H9 > H10) - (L10 - L9) * (H9 - H10 < L10 - L9) * (L9 < L10) + .8 * ((H10 - H11) * (H10 - H11 > L11 - L10) * (H10 > H11) - (L11 - L10) * (H10 - H11 < L11 - L10) * (L10 < L11) + .8 * ((H11 - H12) * (H11 - H12 > L12 - L11) * (H11 > H12) - (L12 - L11) * (H11 - H12 < L12 - L11) * (L11 < L12) + .8 * ((H12 - H13) * (H12 - H13 > L13 - L12) * (H12 > H13) - (L13 - L12) * (H12 - H13 < L13 - L12) * (L12 < L13) + .8 * ((H13 - H14) * (H13 - H14 > L14 - L13) * (H13 > H14) - (L14 - L13) * (H13 - H14 < L14 - L13) * (L13 < L14) + .8 * ((H14 - H15) * (H14 - H15 > L15 - L14) * (H14 > H15) - (L15 - L14) * (H14 - H15 < L15 - L14) * (L14 < L15) + .8 * ((H15 - H16) * (H15 - H16 > L16 - L15) * (H15 > H16) - (L16 - L15) * (H15 - H16 < L16 - L15) * (L15 < L16) + .8 * ((H16 - H17) * (H16 - H17 > L17 - L16) * (H16 > H17) - (L17 - L16) * (H16 - H17 < L17 - L16) * (L16 < L17) + .8 * ((H17 - H18) * (H17 - H18 > L18 - L17) * (H17 > H18) - (L18 - L17) * (H17 - H18 < L18 - L17) * (L17 < L18) + .8 * ((H18 - H19) * (H18 - H19 > L19 - L18) * (H18 > H19) - (L19 - L18) * (H18 - H19 < L19 - L18) * (L18 < L19) + .8 * ((H19 - H20) * (H19 - H20 > L20 - L19) * (H19 > H20) - (L20 - L19) * (H19 - H20 < L20 - L19) * (L19 < L20) + .8 * ((H20 - H21) * (H20 - H21 > L21 - L20) * (H20 > H21) - (L21 - L20) * (H20 - H21 < L21 - L20) * (L20 < L21) + .8 * ((H21 - H22) * (H21 - H22 > L22 - L21) * (H21 > H22) - (L22 - L21) * (H21 - H22 < L22 - L21) * (L21 < L22) + .8 * ((H22 - H23) * (H22 - H23 > L23 - L22) * (H22 > H23) - (L23 - L22) * (H22 - H23 < L23 - L22) * (L22 < L23) + .8 * ((H23 - H24) * (H23 - H24 > L24 - L23) * (H23 > H24) - (L24 - L23) * (H23 - H24 < L24 - L23) * (L23 < L24) + .8 * ((H24 - H25) * (H24 - H25 > L25 - L24) * (H24 > H25) - (L25 - L24) * (H24 - H25 < L25 - L24) * (L24 < L25) + .8 * ((H25 - H26) * (H25 - H26 > L26 - L25) * (H25 > H26) - (L26 - L25) * (H25 - H26 < L26 - L25) * (L25 < L26) + .8 * ((H26 - H27) * (H26 - H27 > L27 - L26) * (H26 > H27) - (L27 - L26) * (H26 - H27 < L27 - L26) * (L26 < L27) + .8 * ((H27 - H28) * (H27 - H28 > L28 - L27) * (H27 > H28) - (L28 - L27) * (H27 - H28 < L28 - L27) * (L27 < L28) + .8 * ((H28 - H29) * (H28 - H29 > L29 - L28) * (H28 > H29) - (L29 - L28) * (H28 - H29 < L29 - L28) * (L28 < L29) + .8 * ((H29 - H30) * (H29 - H30 > L30 - L29) * (H29 > H30) - (L30 - L29) * (H29 - H30 < L30 - L29) * (L29 < L30) + .8 * ((H30 - H31) * (H30 - H31 > L31 - L30) * (H30 > H31) - (L31 - L30) * (H30 - H31 < L31 - L30) * (L30 < L31)))))))))))))))))))))))))))))))) < 0 AND .200198266760174 * ((H1 - H2) * (H1 - H2 > L2 - L1) * (H1 > H2) - (L2 - L1) * (H1 - H2 < L2 - L1) * (L1 < L2) + .8 * ((H2 - H3) * (H2 - H3 > L3 - L2) * (H2 > H3) - (L3 - L2) * (H2 - H3 < L3 - L2) * (L2 < L3) + .8 * ((H3 - H4) * (H3 - H4 > L4 - L3) * (H3 > H4) - (L4 - L3) * (H3 - H4 < L4 - L3) * (L3 < L4) + .8 * ((H4 - H5) * (H4 - H5 > L5 - L4) * (H4 > H5) - (L5 - L4) * (H4 - H5 < L5 - L4) * (L4 < L5) + .8 * ((H5 - H6) * (H5 - H6 > L6 - L5) * (H5 > H6) - (L6 - L5) * (H5 - H6 < L6 - L5) * (L5 < L6) + .8 * ((H6 - H7) * (H6 - H7 > L7 - L6) * (H6 > H7) - (L7 - L6) * (H6 - H7 < L7 - L6) * (L6 < L7) + .8 * ((H7 - H8) * (H7 - H8 > L8 - L7) * (H7 > H8) - (L8 - L7) * (H7 - H8 < L8 - L7) * (L7 < L8) + .8 * ((H8 - H9) * (H8 - H9 > L9 - L8) * (H8 > H9) - (L9 - L8) * (H8 - H9 < L9 - L8) * (L8 < L9) + .8 * ((H9 - H10) * (H9 - H10 > L10 - L9) * (H9 > H10) - (L10 - L9) * (H9 - H10 < L10 - L9) * (L9 < L10) + .8 * ((H10 - H11) * (H10 - H11 > L11 - L10) * (H10 > H11) - (L11 - L10) * (H10 - H11 < L11 - L10) * (L10 < L11) + .8 * ((H11 - H12) * (H11 - H12 > L12 - L11) * (H11 > H12) - (L12 - L11) * (H11 - H12 < L12 - L11) * (L11 < L12) + .8 * ((H12 - H13) * (H12 - H13 > L13 - L12) * (H12 > H13) - (L13 - L12) * (H12 - H13 < L13 - L12) * (L12 < L13) + .8 * ((H13 - H14) * (H13 - H14 > L14 - L13) * (H13 > H14) - (L14 - L13) * (H13 - H14 < L14 - L13) * (L13 < L14) + .8 * ((H14 - H15) * (H14 - H15 > L15 - L14) * (H14 > H15) - (L15 - L14) * (H14 - H15 < L15 - L14) * (L14 < L15) + .8 * ((H15 - H16) * (H15 - H16 > L16 - L15) * (H15 > H16) - (L16 - L15) * (H15 - H16 < L16 - L15) * (L15 < L16) + .8 * ((H16 - H17) * (H16 - H17 > L17 - L16) * (H16 > H17) - (L17 - L16) * (H16 - H17 < L17 - L16) * (L16 < L17) + .8 * ((H17 - H18) * (H17 - H18 > L18 - L17) * (H17 > H18) - (L18 - L17) * (H17 - H18 < L18 - L17) * (L17 < L18) + .8 * ((H18 - H19) * (H18 - H19 > L19 - L18) * (H18 > H19) - (L19 - L18) * (H18 - H19 < L19 - L18) * (L18 < L19) + .8 * ((H19 - H20) * (H19 - H20 > L20 - L19) * (H19 > H20) - (L20 - L19) * (H19 - H20 < L20 - L19) * (L19 < L20) + .8 * ((H20 - H21) * (H20 - H21 > L21 - L20) * (H20 > H21) - (L21 - L20) * (H20 - H21 < L21 - L20) * (L20 < L21) + .8 * ((H21 - H22) * (H21 - H22 > L22 - L21) * (H21 > H22) - (L22 - L21) * (H21 - H22 < L22 - L21) * (L21 < L22) + .8 * ((H22 - H23) * (H22 - H23 > L23 - L22) * (H22 > H23) - (L23 - L22) * (H22 - H23 < L23 - L22) * (L22 < L23) + .8 * ((H23 - H24) * (H23 - H24 > L24 - L23) * (H23 > H24) - (L24 - L23) * (H23 - H24 < L24 - L23) * (L23 < L24) + .8 * ((H24 - H25) * (H24 - H25 > L25 - L24) * (H24 > H25) - (L25 - L24) * (H24 - H25 < L25 - L24) * (L24 < L25) + .8 * ((H25 - H26) * (H25 - H26 > L26 - L25) * (H25 > H26) - (L26 - L25) * (H25 - H26 < L26 - L25) * (L25 < L26) + .8 * ((H26 - H27) * (H26 - H27 > L27 - L26) * (H26 > H27) - (L27 - L26) * (H26 - H27 < L27 - L26) * (L26 < L27) + .8 * ((H27 - H28) * (H27 - H28 > L28 - L27) * (H27 > H28) - (L28 - L27) * (H27 - H28 < L28 - L27) * (L27 < L28) + .8 * ((H28 - H29) * (H28 - H29 > L29 - L28) * (H28 > H29) - (L29 - L28) * (H28 - H29 < L29 - L28) * (L28 < L29) + .8 * ((H29 - H30) * (H29 - H30 > L30 - L29) * (H29 > H30) - (L30 - L29) * (H29 - H30 < L30 - L29) * (L29 < L30) + .8 * ((H30 - H31) * (H30 - H31 > L31 - L30) * (H30 > H31) - (L31 - L30) * (H30 - H31 < L31 - L30) * (L30 < L31) + .8 * ((H31 - H32) * (H31 - H32 > L32 - L31) * (H31 > H32) - (L32 - L31) * (H31 - H32 < L32 - L31) * (L31 < L32)))))))))))))))))))))))))))))))) >= 0

5-Period +DI crossing -DI (either direction):

SGN(.200198266760174 * ((H - H1) * (H - H1 > L1 - L) * (H > H1) - (L1 - L) * (H - H1 < L1 - L) * (L < L1) + .8 * ((H1 - H2) * (H1 - H2 > L2 - L1) * (H1 > H2) - (L2 - L1) * (H1 - H2 < L2 - L1) * (L1 < L2) + .8 * ((H2 - H3) * (H2 - H3 > L3 - L2) * (H2 > H3) - (L3 - L2) * (H2 - H3 < L3 - L2) * (L2 < L3) + .8 * ((H3 - H4) * (H3 - H4 > L4 - L3) * (H3 > H4) - (L4 - L3) * (H3 - H4 < L4 - L3) * (L3 < L4) + .8 * ((H4 - H5) * (H4 - H5 > L5 - L4) * (H4 > H5) - (L5 - L4) * (H4 - H5 < L5 - L4) * (L4 < L5) + .8 * ((H5 - H6) * (H5 - H6 > L6 - L5) * (H5 > H6) - (L6 - L5) * (H5 - H6 < L6 - L5) * (L5 < L6) + .8 * ((H6 - H7) * (H6 - H7 > L7 - L6) * (H6 > H7) - (L7 - L6) * (H6 - H7 < L7 - L6) * (L6 < L7) + .8 * ((H7 - H8) * (H7 - H8 > L8 - L7) * (H7 > H8) - (L8 - L7) * (H7 - H8 < L8 - L7) * (L7 < L8) + .8 * ((H8 - H9) * (H8 - H9 > L9 - L8) * (H8 > H9) - (L9 - L8) * (H8 - H9 < L9 - L8) * (L8 < L9) + .8 * ((H9 - H10) * (H9 - H10 > L10 - L9) * (H9 > H10) - (L10 - L9) * (H9 - H10 < L10 - L9) * (L9 < L10) + .8 * ((H10 - H11) * (H10 - H11 > L11 - L10) * (H10 > H11) - (L11 - L10) * (H10 - H11 < L11 - L10) * (L10 < L11) + .8 * ((H11 - H12) * (H11 - H12 > L12 - L11) * (H11 > H12) - (L12 - L11) * (H11 - H12 < L12 - L11) * (L11 < L12) + .8 * ((H12 - H13) * (H12 - H13 > L13 - L12) * (H12 > H13) - (L13 - L12) * (H12 - H13 < L13 - L12) * (L12 < L13) + .8 * ((H13 - H14) * (H13 - H14 > L14 - L13) * (H13 > H14) - (L14 - L13) * (H13 - H14 < L14 - L13) * (L13 < L14) + .8 * ((H14 - H15) * (H14 - H15 > L15 - L14) * (H14 > H15) - (L15 - L14) * (H14 - H15 < L15 - L14) * (L14 < L15) + .8 * ((H15 - H16) * (H15 - H16 > L16 - L15) * (H15 > H16) - (L16 - L15) * (H15 - H16 < L16 - L15) * (L15 < L16) + .8 * ((H16 - H17) * (H16 - H17 > L17 - L16) * (H16 > H17) - (L17 - L16) * (H16 - H17 < L17 - L16) * (L16 < L17) + .8 * ((H17 - H18) * (H17 - H18 > L18 - L17) * (H17 > H18) - (L18 - L17) * (H17 - H18 < L18 - L17) * (L17 < L18) + .8 * ((H18 - H19) * (H18 - H19 > L19 - L18) * (H18 > H19) - (L19 - L18) * (H18 - H19 < L19 - L18) * (L18 < L19) + .8 * ((H19 - H20) * (H19 - H20 > L20 - L19) * (H19 > H20) - (L20 - L19) * (H19 - H20 < L20 - L19) * (L19 < L20) + .8 * ((H20 - H21) * (H20 - H21 > L21 - L20) * (H20 > H21) - (L21 - L20) * (H20 - H21 < L21 - L20) * (L20 < L21) + .8 * ((H21 - H22) * (H21 - H22 > L22 - L21) * (H21 > H22) - (L22 - L21) * (H21 - H22 < L22 - L21) * (L21 < L22) + .8 * ((H22 - H23) * (H22 - H23 > L23 - L22) * (H22 > H23) - (L23 - L22) * (H22 - H23 < L23 - L22) * (L22 < L23) + .8 * ((H23 - H24) * (H23 - H24 > L24 - L23) * (H23 > H24) - (L24 - L23) * (H23 - H24 < L24 - L23) * (L23 < L24) + .8 * ((H24 - H25) * (H24 - H25 > L25 - L24) * (H24 > H25) - (L25 - L24) * (H24 - H25 < L25 - L24) * (L24 < L25) + .8 * ((H25 - H26) * (H25 - H26 > L26 - L25) * (H25 > H26) - (L26 - L25) * (H25 - H26 < L26 - L25) * (L25 < L26) + .8 * ((H26 - H27) * (H26 - H27 > L27 - L26) * (H26 > H27) - (L27 - L26) * (H26 - H27 < L27 - L26) * (L26 < L27) + .8 * ((H27 - H28) * (H27 - H28 > L28 - L27) * (H27 > H28) - (L28 - L27) * (H27 - H28 < L28 - L27) * (L27 < L28) + .8 * ((H28 - H29) * (H28 - H29 > L29 - L28) * (H28 > H29) - (L29 - L28) * (H28 - H29 < L29 - L28) * (L28 < L29) + .8 * ((H29 - H30) * (H29 - H30 > L30 - L29) * (H29 > H30) - (L30 - L29) * (H29 - H30 < L30 - L29) * (L29 < L30) + .8 * ((H30 - H31) * (H30 - H31 > L31 - L30) * (H30 > H31) - (L31 - L30) * (H30 - H31 < L31 - L30) * (L30 < L31))))))))))))))))))))))))))))))))) <> SGN(.200198266760174 * ((H1 - H2) * (H1 - H2 > L2 - L1) * (H1 > H2) - (L2 - L1) * (H1 - H2 < L2 - L1) * (L1 < L2) + .8 * ((H2 - H3) * (H2 - H3 > L3 - L2) * (H2 > H3) - (L3 - L2) * (H2 - H3 < L3 - L2) * (L2 < L3) + .8 * ((H3 - H4) * (H3 - H4 > L4 - L3) * (H3 > H4) - (L4 - L3) * (H3 - H4 < L4 - L3) * (L3 < L4) + .8 * ((H4 - H5) * (H4 - H5 > L5 - L4) * (H4 > H5) - (L5 - L4) * (H4 - H5 < L5 - L4) * (L4 < L5) + .8 * ((H5 - H6) * (H5 - H6 > L6 - L5) * (H5 > H6) - (L6 - L5) * (H5 - H6 < L6 - L5) * (L5 < L6) + .8 * ((H6 - H7) * (H6 - H7 > L7 - L6) * (H6 > H7) - (L7 - L6) * (H6 - H7 < L7 - L6) * (L6 < L7) + .8 * ((H7 - H8) * (H7 - H8 > L8 - L7) * (H7 > H8) - (L8 - L7) * (H7 - H8 < L8 - L7) * (L7 < L8) + .8 * ((H8 - H9) * (H8 - H9 > L9 - L8) * (H8 > H9) - (L9 - L8) * (H8 - H9 < L9 - L8) * (L8 < L9) + .8 * ((H9 - H10) * (H9 - H10 > L10 - L9) * (H9 > H10) - (L10 - L9) * (H9 - H10 < L10 - L9) * (L9 < L10) + .8 * ((H10 - H11) * (H10 - H11 > L11 - L10) * (H10 > H11) - (L11 - L10) * (H10 - H11 < L11 - L10) * (L10 < L11) + .8 * ((H11 - H12) * (H11 - H12 > L12 - L11) * (H11 > H12) - (L12 - L11) * (H11 - H12 < L12 - L11) * (L11 < L12) + .8 * ((H12 - H13) * (H12 - H13 > L13 - L12) * (H12 > H13) - (L13 - L12) * (H12 - H13 < L13 - L12) * (L12 < L13) + .8 * ((H13 - H14) * (H13 - H14 > L14 - L13) * (H13 > H14) - (L14 - L13) * (H13 - H14 < L14 - L13) * (L13 < L14) + .8 * ((H14 - H15) * (H14 - H15 > L15 - L14) * (H14 > H15) - (L15 - L14) * (H14 - H15 < L15 - L14) * (L14 < L15) + .8 * ((H15 - H16) * (H15 - H16 > L16 - L15) * (H15 > H16) - (L16 - L15) * (H15 - H16 < L16 - L15) * (L15 < L16) + .8 * ((H16 - H17) * (H16 - H17 > L17 - L16) * (H16 > H17) - (L17 - L16) * (H16 - H17 < L17 - L16) * (L16 < L17) + .8 * ((H17 - H18) * (H17 - H18 > L18 - L17) * (H17 > H18) - (L18 - L17) * (H17 - H18 < L18 - L17) * (L17 < L18) + .8 * ((H18 - H19) * (H18 - H19 > L19 - L18) * (H18 > H19) - (L19 - L18) * (H18 - H19 < L19 - L18) * (L18 < L19) + .8 * ((H19 - H20) * (H19 - H20 > L20 - L19) * (H19 > H20) - (L20 - L19) * (H19 - H20 < L20 - L19) * (L19 < L20) + .8 * ((H20 - H21) * (H20 - H21 > L21 - L20) * (H20 > H21) - (L21 - L20) * (H20 - H21 < L21 - L20) * (L20 < L21) + .8 * ((H21 - H22) * (H21 - H22 > L22 - L21) * (H21 > H22) - (L22 - L21) * (H21 - H22 < L22 - L21) * (L21 < L22) + .8 * ((H22 - H23) * (H22 - H23 > L23 - L22) * (H22 > H23) - (L23 - L22) * (H22 - H23 < L23 - L22) * (L22 < L23) + .8 * ((H23 - H24) * (H23 - H24 > L24 - L23) * (H23 > H24) - (L24 - L23) * (H23 - H24 < L24 - L23) * (L23 < L24) + .8 * ((H24 - H25) * (H24 - H25 > L25 - L24) * (H24 > H25) - (L25 - L24) * (H24 - H25 < L25 - L24) * (L24 < L25) + .8 * ((H25 - H26) * (H25 - H26 > L26 - L25) * (H25 > H26) - (L26 - L25) * (H25 - H26 < L26 - L25) * (L25 < L26) + .8 * ((H26 - H27) * (H26 - H27 > L27 - L26) * (H26 > H27) - (L27 - L26) * (H26 - H27 < L27 - L26) * (L26 < L27) + .8 * ((H27 - H28) * (H27 - H28 > L28 - L27) * (H27 > H28) - (L28 - L27) * (H27 - H28 < L28 - L27) * (L27 < L28) + .8 * ((H28 - H29) * (H28 - H29 > L29 - L28) * (H28 > H29) - (L29 - L28) * (H28 - H29 < L29 - L28) * (L28 < L29) + .8 * ((H29 - H30) * (H29 - H30 > L30 - L29) * (H29 > H30) - (L30 - L29) * (H29 - H30 < L30 - L29) * (L29 < L30) + .8 * ((H30 - H31) * (H30 - H31 > L31 - L30) * (H30 > H31) - (L31 - L30) * (H30 - H31 < L31 - L30) * (L30 < L31) + .8 * ((H31 - H32) * (H31 - H32 > L32 - L31) * (H31 > H32) - (L32 - L31) * (H31 - H32 < L32 - L31) * (L31 < L32)))))))))))))))))))))))))))))))))

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

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.