TC2000.com• Download software • Tutorial videos • Subscription & data-feed pricing • Class schedule
TC2000Brokerage.com• New account application • Trading resources • Margin rates • Stock & option commissions
Worden Discussion Forum » Customer Training & Support » Ask a Trainer - TC2000 version 12/18 » adx segment
Hi Bruce:
Is it possible to write a pcf which gives the net price change since beginning of the
increase if adx(14,14) is increasing, and similarly, the net price change since beginning
of the decrease if adx(14,14) is decreasing. (In other words, how much has the price
changed since adx last changed direction --- assume the segment begins on the
open of the price bar of the most recent adx directional change.)?
The following checks the most recent 60 bars for a change in direction of the ADX.
C - IIF(SGN(ADX14.14 - ADX14.14.1) <> SGN(ADX14.14.1 - ADX14.14.2), O, IIF(SGN(ADX14.14.1 - ADX14.14.2) <> SGN(ADX14.14.2 - ADX14.14.3), O1, IIF(SGN(ADX14.14.2 - ADX14.14.3) <> SGN(ADX14.14.3 - ADX14.14.4), O2, IIF(SGN(ADX14.14.3 - ADX14.14.4) <> SGN(ADX14.14.4 - ADX14.14.5), O3, IIF(SGN(ADX14.14.4 - ADX14.14.5) <> SGN(ADX14.14.5 - ADX14.14.6), O4, IIF(SGN(ADX14.14.5 - ADX14.14.6) <> SGN(ADX14.14.6 - ADX14.14.7), O5, IIF(SGN(ADX14.14.6 - ADX14.14.7) <> SGN(ADX14.14.7 - ADX14.14.8), O6, IIF(SGN(ADX14.14.7 - ADX14.14.8) <> SGN(ADX14.14.8 - ADX14.14.9), O7, IIF(SGN(ADX14.14.8 - ADX14.14.9) <> SGN(ADX14.14.9 - ADX14.14.10), O8, IIF(SGN(ADX14.14.9 - ADX14.14.10) <> SGN(ADX14.14.10 - ADX14.14.11), O9, IIF(SGN(ADX14.14.10 - ADX14.14.11) <> SGN(ADX14.14.11 - ADX14.14.12), O10, IIF(SGN(ADX14.14.11 - ADX14.14.12) <> SGN(ADX14.14.12 - ADX14.14.13), O11, IIF(SGN(ADX14.14.12 - ADX14.14.13) <> SGN(ADX14.14.13 - ADX14.14.14), O12, IIF(SGN(ADX14.14.13 - ADX14.14.14) <> SGN(ADX14.14.14 - ADX14.14.15), O13, IIF(SGN(ADX14.14.14 - ADX14.14.15) <> SGN(ADX14.14.15 - ADX14.14.16), O14, IIF(SGN(ADX14.14.15 - ADX14.14.16) <> SGN(ADX14.14.16 - ADX14.14.17), O15, IIF(SGN(ADX14.14.16 - ADX14.14.17) <> SGN(ADX14.14.17 - ADX14.14.18), O16, IIF(SGN(ADX14.14.17 - ADX14.14.18) <> SGN(ADX14.14.18 - ADX14.14.19), O17, IIF(SGN(ADX14.14.18 - ADX14.14.19) <> SGN(ADX14.14.19 - ADX14.14.20), O18, IIF(SGN(ADX14.14.19 - ADX14.14.20) <> SGN(ADX14.14.20 - ADX14.14.21), O19, IIF(SGN(ADX14.14.20 - ADX14.14.21) <> SGN(ADX14.14.21 - ADX14.14.22), O20, IIF(SGN(ADX14.14.21 - ADX14.14.22) <> SGN(ADX14.14.22 - ADX14.14.23), O21, IIF(SGN(ADX14.14.22 - ADX14.14.23) <> SGN(ADX14.14.23 - ADX14.14.24), O22, IIF(SGN(ADX14.14.23 - ADX14.14.24) <> SGN(ADX14.14.24 - ADX14.14.25), O23, IIF(SGN(ADX14.14.24 - ADX14.14.25) <> SGN(ADX14.14.25 - ADX14.14.26), O24, IIF(SGN(ADX14.14.25 - ADX14.14.26) <> SGN(ADX14.14.26 - ADX14.14.27), O25, IIF(SGN(ADX14.14.26 - ADX14.14.27) <> SGN(ADX14.14.27 - ADX14.14.28), O26, IIF(SGN(ADX14.14.27 - ADX14.14.28) <> SGN(ADX14.14.28 - ADX14.14.29), O27, IIF(SGN(ADX14.14.28 - ADX14.14.29) <> SGN(ADX14.14.29 - ADX14.14.30), O28, IIF(SGN(ADX14.14.29 - ADX14.14.30) <> SGN(ADX14.14.30 - ADX14.14.31), O29, IIF(SGN(ADX14.14.30 - ADX14.14.31) <> SGN(ADX14.14.31 - ADX14.14.32), O30, IIF(SGN(ADX14.14.31 - ADX14.14.32) <> SGN(ADX14.14.32 - ADX14.14.33), O31, IIF(SGN(ADX14.14.32 - ADX14.14.33) <> SGN(ADX14.14.33 - ADX14.14.34), O32, IIF(SGN(ADX14.14.33 - ADX14.14.34) <> SGN(ADX14.14.34 - ADX14.14.35), O33, IIF(SGN(ADX14.14.34 - ADX14.14.35) <> SGN(ADX14.14.35 - ADX14.14.36), O34, IIF(SGN(ADX14.14.35 - ADX14.14.36) <> SGN(ADX14.14.36 - ADX14.14.37), O35, IIF(SGN(ADX14.14.36 - ADX14.14.37) <> SGN(ADX14.14.37 - ADX14.14.38), O36, IIF(SGN(ADX14.14.37 - ADX14.14.38) <> SGN(ADX14.14.38 - ADX14.14.39), O37, IIF(SGN(ADX14.14.38 - ADX14.14.39) <> SGN(ADX14.14.39 - ADX14.14.40), O38, IIF(SGN(ADX14.14.39 - ADX14.14.40) <> SGN(ADX14.14.40 - ADX14.14.41), O39, IIF(SGN(ADX14.14.40 - ADX14.14.41) <> SGN(ADX14.14.41 - ADX14.14.42), O40, IIF(SGN(ADX14.14.41 - ADX14.14.42) <> SGN(ADX14.14.42 - ADX14.14.43), O41, IIF(SGN(ADX14.14.42 - ADX14.14.43) <> SGN(ADX14.14.43 - ADX14.14.44), O42, IIF(SGN(ADX14.14.43 - ADX14.14.44) <> SGN(ADX14.14.44 - ADX14.14.45), O43, IIF(SGN(ADX14.14.44 - ADX14.14.45) <> SGN(ADX14.14.45 - ADX14.14.46), O44, IIF(SGN(ADX14.14.45 - ADX14.14.46) <> SGN(ADX14.14.46 - ADX14.14.47), O45, IIF(SGN(ADX14.14.46 - ADX14.14.47) <> SGN(ADX14.14.47 - ADX14.14.48), O46, IIF(SGN(ADX14.14.47 - ADX14.14.48) <> SGN(ADX14.14.48 - ADX14.14.49), O47, IIF(SGN(ADX14.14.48 - ADX14.14.49) <> SGN(ADX14.14.49 - ADX14.14.50), O48, IIF(SGN(ADX14.14.49 - ADX14.14.50) <> SGN(ADX14.14.50 - ADX14.14.51), O49, IIF(SGN(ADX14.14.50 - ADX14.14.51) <> SGN(ADX14.14.51 - ADX14.14.52), O50, IIF(SGN(ADX14.14.51 - ADX14.14.52) <> SGN(ADX14.14.52 - ADX14.14.53), O51, IIF(SGN(ADX14.14.52 - ADX14.14.53) <> SGN(ADX14.14.53 - ADX14.14.54), O52, IIF(SGN(ADX14.14.53 - ADX14.14.54) <> SGN(ADX14.14.54 - ADX14.14.55), O53, IIF(SGN(ADX14.14.54 - ADX14.14.55) <> SGN(ADX14.14.55 - ADX14.14.56), O54, IIF(SGN(ADX14.14.55 - ADX14.14.56) <> SGN(ADX14.14.56 - ADX14.14.57), O55, IIF(SGN(ADX14.14.56 - ADX14.14.57) <> SGN(ADX14.14.57 - ADX14.14.58), O56, IIF(SGN(ADX14.14.57 - ADX14.14.58) <> SGN(ADX14.14.58 - ADX14.14.59), O57, IIF(SGN(ADX14.14.58 - ADX14.14.59) <> SGN(ADX14.14.59 - ADX14.14.60), O58, IIF(SGN(ADX14.14.59 - ADX14.14.60) <> SGN(ADX14.14.60 - ADX14.14.61), O59, 1 / 0))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
Perfect. Thanks!
Bruce
Can you do a % version of this?
(Only with ADX increasing)
Most recent 30 bars.
Thanks
Maybe the following?
100 * (C / IIF(ADX14.14 > ADX14.14.1, IIF(SGN(ADX14.14 - ADX14.14.1) <> SGN(ADX14.14.1 - ADX14.14.2), O, IIF(SGN(ADX14.14.1 - ADX14.14.2) <> SGN(ADX14.14.2 - ADX14.14.3), O1, IIF(SGN(ADX14.14.2 - ADX14.14.3) <> SGN(ADX14.14.3 - ADX14.14.4), O2, IIF(SGN(ADX14.14.3 - ADX14.14.4) <> SGN(ADX14.14.4 - ADX14.14.5), O3, IIF(SGN(ADX14.14.4 - ADX14.14.5) <> SGN(ADX14.14.5 - ADX14.14.6), O4, IIF(SGN(ADX14.14.5 - ADX14.14.6) <> SGN(ADX14.14.6 - ADX14.14.7), O5, IIF(SGN(ADX14.14.6 - ADX14.14.7) <> SGN(ADX14.14.7 - ADX14.14.8), O6, IIF(SGN(ADX14.14.7 - ADX14.14.8) <> SGN(ADX14.14.8 - ADX14.14.9), O7, IIF(SGN(ADX14.14.8 - ADX14.14.9) <> SGN(ADX14.14.9 - ADX14.14.10), O8, IIF(SGN(ADX14.14.9 - ADX14.14.10) <> SGN(ADX14.14.10 - ADX14.14.11), O9, IIF(SGN(ADX14.14.10 - ADX14.14.11) <> SGN(ADX14.14.11 - ADX14.14.12), O10, IIF(SGN(ADX14.14.11 - ADX14.14.12) <> SGN(ADX14.14.12 - ADX14.14.13), O11, IIF(SGN(ADX14.14.12 - ADX14.14.13) <> SGN(ADX14.14.13 - ADX14.14.14), O12, IIF(SGN(ADX14.14.13 - ADX14.14.14) <> SGN(ADX14.14.14 - ADX14.14.15), O13, IIF(SGN(ADX14.14.14 - ADX14.14.15) <> SGN(ADX14.14.15 - ADX14.14.16), O14, IIF(SGN(ADX14.14.15 - ADX14.14.16) <> SGN(ADX14.14.16 - ADX14.14.17), O15, IIF(SGN(ADX14.14.16 - ADX14.14.17) <> SGN(ADX14.14.17 - ADX14.14.18), O16, IIF(SGN(ADX14.14.17 - ADX14.14.18) <> SGN(ADX14.14.18 - ADX14.14.19), O17, IIF(SGN(ADX14.14.18 - ADX14.14.19) <> SGN(ADX14.14.19 - ADX14.14.20), O18, IIF(SGN(ADX14.14.19 - ADX14.14.20) <> SGN(ADX14.14.20 - ADX14.14.21), O19, IIF(SGN(ADX14.14.20 - ADX14.14.21) <> SGN(ADX14.14.21 - ADX14.14.22), O20, IIF(SGN(ADX14.14.21 - ADX14.14.22) <> SGN(ADX14.14.22 - ADX14.14.23), O21, IIF(SGN(ADX14.14.22 - ADX14.14.23) <> SGN(ADX14.14.23 - ADX14.14.24), O22, IIF(SGN(ADX14.14.23 - ADX14.14.24) <> SGN(ADX14.14.24 - ADX14.14.25), O23, IIF(SGN(ADX14.14.24 - ADX14.14.25) <> SGN(ADX14.14.25 - ADX14.14.26), O24, IIF(SGN(ADX14.14.25 - ADX14.14.26) <> SGN(ADX14.14.26 - ADX14.14.27), O25, IIF(SGN(ADX14.14.26 - ADX14.14.27) <> SGN(ADX14.14.27 - ADX14.14.28), O26, IIF(SGN(ADX14.14.27 - ADX14.14.28) <> SGN(ADX14.14.28 - ADX14.14.29), O27, IIF(SGN(ADX14.14.28 - ADX14.14.29) <> SGN(ADX14.14.29 - ADX14.14.30), O28, IIF(SGN(ADX14.14.29 - ADX14.14.30) <> SGN(ADX14.14.30 - ADX14.14.31), O29, 1 / 0)))))))))))))))))))))))))))))), 1 / 0) - 1)
Why is the value on he following sometimes delayed?
If you're displaying this as a column, Edit the column and check the Refresh Rate. By default it will be Manual which means you need to click Refresh to get updated values.
I'm not sure I understand. This is a pcf on a chart.
It shouldn't be delayed on the chart. You may want to contact technical support.
I am interested in plotting the midpoint price between the price in which adx was highest in the last 200
periods and the price in which adx was lowest in the last 200 periods.
I do not know of any way to write a formula for that which is not too long and slow to be practical or post in the forums.
Thanks.
HI Bruce:
Is it possible to write a PCF that gives the last price at which ADX has crossed an
integer multiple of 10?
No, I can't really think of a practical way to do this.
I see...
The best
I can get is this: b=
iif(xup(adx14.14,10,1) or xdown(adx14.14,10,1) or
But you would need nested a bunch of IIF() statetments (one for each bar you wish to test) to get the value of C at the most recent cross (and the formula to test for the cross is long in and of itself).
Even if you stop there, it pretty much ends up too long and slow to be practical. But I would think you want to find the value of C at the cross and not the value of C and the end of the bar where the cross happens (and this formula way more complicated than just C and would need to be duplicated at each bar).
Thank you. I will settle on my rough average...
Please try the following:
SUM(IIF(ADX14.14 \ 10 <> ADX14.14.1 \ 10, C, 0), 200) / CountTrue(ADX14.14 \ 10 <> ADX14.14.1 \ 10, 200)
Nice.... Thank you.
You're welcome.