Registered User Joined: 1/5/2008 Posts: 111

I want to add a condition to the end of a boolean formula for the following condition
ADX 14 < 25
I would appreciate it if you would help me with the PCF. I tried "and ADX (14) < 25" but it is not working.


Administration
Joined: 9/30/2004 Posts: 9,038

In version 17, the proper formula is ADX(14,14) < 25
You have to set the smoothing period 14 and the DI period 14.
Example http://forums.worden.com/default.aspx?g=posts&t=66511


Registered User Joined: 1/5/2008 Posts: 111

Perfect. Thanks very much. One more question please. The scroll bar in the bottom right hand corner of the chart screen seems much more narrow in 17 as opposed to 12.4. Is there a way to increase the width of the bar?
Thanks


Registered User Joined: 1/5/2008 Posts: 111

I figured out how to adjust the scroll bar from another post. No need to reply again. Thanks


Worden Trainer
Joined: 10/7/2004 Posts: 63,008

I am happy to read you were able to figure it out on your own.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/26/2011 Posts: 125

Is there a way to determine if ADX formula (say 14,14) will be decreasing at the open of the next bar?


Worden Trainer
Joined: 10/7/2004 Posts: 63,008

No, there is no way to tell what what the ADX is going to do before it does it.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/26/2011 Posts: 125

I meant to add: "assuming AS IF the current bar has closed ( and the new open is at the current price)".


Worden Trainer
Joined: 10/7/2004 Posts: 63,008

No, I can't calculate that either.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/26/2011 Posts: 125

Thank you.


Gold Customer
Joined: 4/30/2015 Posts: 190

is their a way to calculate the lower bar level and the upper bar level as 2 lines (like a bollinger band top and bottom)


Gold Customer
Joined: 4/30/2015 Posts: 190

can you not say ADX (14 , 14) is less than ADX ( 14.1,14.1)
or the equivlent of that


Gold Customer
Joined: 4/30/2015 Posts: 190

How about this ADX is less that ADX of bar before
ADX14.14.0 < ADX14.14.1


Worden Trainer
Joined: 10/7/2004 Posts: 63,008

QUOTE (Aces4Me) is their a way to calculate the lower bar level and the upper bar level as 2 lines (like a bollinger band top and bottom)
I am not quite sure what you mean by this. Assuming it is something like calculating what the highest and lowest ADX where throughout the trading day and plotting these values, then no, it is not possible.
But if you want to plot the highest and lowest ADX closing values over time, you could add Donchian Channels to the ADX indicator. Or use something like the following to plot the highest ADX over the most recent 10 bars bars.
MAX(ADX14.14, 10)
Or something like the following to plot the lowest ADX over the 15 bars ending during the previous bar.
MIN(ADX14.14.1, 15)
The following formula you created:
ADX14.14.0 < ADX14.14.1
Should work for checking if the current 14 period ADX is lower than the previous 14 period ADX.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/26/2011 Posts: 125

QUOTE (Bruce_L)
No, there is no way to tell what what the ADX is going to do before it does it.
Hi Bruce:
Can you answer the above question for adx(14,14) if we replace the exponential smoothing in adx
with frontweighted averages (which have (finite) 14 or 15 terms)?


Worden Trainer
Joined: 10/7/2004 Posts: 63,008

OK, I have rethought my previous answer.
Theoretically the formula is probably more straightforward with the front weighted moving average than with the regular ADX. But because we have components calculated for us, it is actually easier to write a formula to check what the value of the regular ADX would be tomorrow's open if price doesn't change at all between now and then.
Keep in mind that the contribution of the next bar will be 0 to both +DI and DI if the next bar has zero range and opens at the close of the current bar. ATR will also have a TR of 0 for the next bar in these circumstances.
So we know that +DI and DI will be both unchanged if price does not change at all between the current price and tomorrow's open.
This means that the 14period ADX at the open would be the following if price doesn't change at all before the open.
(ADX14.1 + 13 * ADX14.14) / 14
This means ADX would go up if and only if:
ADX14.1 > ADX14.14
And go down if and only if:
ADX14.1 < ADX14.14
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/26/2011 Posts: 125

Gracias!!


Registered User Joined: 6/26/2011 Posts: 125

Hi Bruce:
1. I am wondering why the formula below is not
(2*adx14.1 + 13*adx14.14)/15 since we are using exponential smoothing
wouldn't the weight would be 2/(.14+1)?
2. If we don't worry about the data/weights more than 14 or 15 periods back (to make the calculation finite)  can we compute what the price c0 would be where adx14.1=adx14.14 (assume the price c0 is less than or equal to c1 if necessary).
QUOTE (Bruce_L)
OK, I have rethought my previous answer.
(ADX14.1 + 13 * ADX14.14) / 14


Worden Trainer
Joined: 10/7/2004 Posts: 63,008

The ADX indicator uses Wilder's smoothing. While it is a type of exponential smoothing the weight is different.
Normal exponential smoothing uses:
XAVG(x, p) = (2 * x + (p  1) * XAVG(x1, p)) / (p + 1)
But Wilder's smoothing uses (note that Wilder's smoothing is not actually built into the PCF language).
Wilder(x, p) = (x + (p  1) * Wilder(x1, p)) / p
Also note that if you double the Wilder's period and subtract one, you get the period which can be used in an exponential moving average to duplicate the Wilder's smoothing.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/26/2011 Posts: 125

I see.... Is it possible to solve for C0, where adx14.1=adx14.14 ?


Worden Trainer
Joined: 10/7/2004 Posts: 63,008

No, I do not know of a practical method of doing so using the Personal Criteria Formula Language.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/26/2011 Posts: 125

Thank you.


Worden Trainer
Joined: 10/7/2004 Posts: 63,008

You're welcome.
Bruce Personal Criteria Formulas TC2000 Support Articles


Guest1 