Gold Customer
Joined: 11/19/2015 Posts: 444

Hello.
Does:
COUNTTRUE(XDOWN(C, BBBOT(2, 20)), 300)
include "touches" where the lower bound is touched (equalled) but not crossed?
Thank you.


Worden Trainer
Joined: 10/7/2004 Posts: 64,491

Yes, it should included touches. That said, an exact touch of the current or closing price to either the top of bottom Bollinger Band is highly improbable for actively trading stocks.
A way to write this which would avoid this almost theoretical possibility would be as follows.
COUNTTRUE(TrueInRow(C < BBBOT(2, 20), 2) = 1, 300)
Bruce Personal Criteria Formulas TC2000 Support Articles


Gold Customer
Joined: 11/19/2015 Posts: 444

Thanks, Bruce. Just wanted to be certain. Thanks again.


Registered User Joined: 12/27/2013 Posts: 152

Please write for me the fornula for the exponential moving average(with period "p") of the macd histogram, macdHi,j,k


Worden Trainer
Joined: 10/7/2004 Posts: 64,491

Please try the following in TC2000 v17 (note, you will actually have to enter the desired periods in the formula).
XAVG(MACDi.j  XAVG(MACDi.j, k), p)
MACD & MACD Histogram
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 12/27/2013 Posts: 152

will it work well in freestockcharts.com?


Worden Trainer
Joined: 10/7/2004 Posts: 64,491

No, it will only work in TC2000 v17. The formula for earlier versions is going to be quite a bit longer and will have the limitation that k cannot equal p.
XAVG(XAVGCi, p)  XAVG(XAVGCj, p)  ((k  1) * XAVG(XAVGCi, k)  (p  1) * XAVG(XAVGCi, p)) / (k  p) + ((k  1) * XAVG(XAVGCj, k)  (p  1) * XAVG(XAVGCj, p)) / (k  p)
Bruce Personal Criteria Formulas TC2000 Support Articles


Gold Customer
Joined: 11/19/2015 Posts: 444

Bruce, the chart hover info panel doesn't display price for the BB top/centerline/bottom. How can I return price for these levels?


Worden Trainer
Joined: 10/7/2004 Posts: 64,491

Is this in TC2000 v7 or TC2000 v17?
The pointer mode data box should display the value of both the top and bottom Bollinger Bands in TC2000 v17. You can add a moving average using the same period and average type as the Bollinger Bands to get the value of the centerline.
In TC2000 v7, you would probably need to add custom indicators to the chart using formulas for the top, bottom and centerline to the top pane of the chart. And while it won't make a difference to the displayed values, you may as well set these to scale with price.
Top BB 20, 20:
AVGC20 + 2 * SQR(ABS(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2  20 * AVGC20 ^ 2) / 19)
Center 20:
AVGC20
Bottom BB 20, 20:
AVGC20  2 * SQR(ABS(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2  20 * AVGC20 ^ 2) / 19)
Bruce Personal Criteria Formulas TC2000 Support Articles


Gold Customer
Joined: 11/19/2015 Posts: 444

Thank you for the help. My error; everything works perfectly.


Registered User Joined: 12/27/2013 Posts: 152

Thank you.


Registered User Joined: 12/27/2013 Posts: 152

Please write for me the fornula for the simple moving average(with period "p") of the exponential macd histogram, macdHi,j,k (please use freestock.com syntax)


Worden Trainer
Joined: 10/7/2004 Posts: 64,491

k cannot equal either i or j in the following.
AVG(XAVGCi, p)  AVG(XAVGCj, p)  ((i  1) * AVG(XAVGCi, p)  (k  1) * AVG(XAVGCk, p)) / (i  k) + ((j  1) * AVG(XAVGCj, p)  (k  1) * AVG(XAVGCk, p)) / (j  k)
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 12/27/2013 Posts: 152

Please write for me:
(i) The simple moving average AVGCi of the exponential moving average XAVGCj
(i)The exponential moving average XAVGCj of the simple moving average AVGCi
in the freestockchart.com code.


Worden Trainer
Joined: 10/7/2004 Posts: 64,491

QUOTE (email2norman) (i) The simple moving average AVGCi of the exponential moving average XAVGCj
AVG(XAVGCj, i)
QUOTE (email2norman) (i)The exponential moving average XAVGCj of the simple moving average AVGCi
XAVG(AVGCi, j)
Note that these formulas are actually the same thing despite the reversed order.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 12/27/2013 Posts: 152

Thank you Bruce


Registered User Joined: 12/27/2013 Posts: 152

The exponential moving average XAVGCj of the exponential moving average XAVGCi isXAVG(XAVGCi, j) Correct?If that is correct, please write the formula for the exponential moving average XAVGCk of the difference:(XAVGCi)(XAVG(XAVGCi, j))


Worden Trainer
Joined: 10/7/2004 Posts: 64,491

That already is how I would write it.
XAVGCi  XAVG(XAVGCi, j)
Assuming i <> j , this could also be written as follows if you want to avoid the nested exponential moving average.
XAVGCi  ((i  1) * XAVGCi  (j  1) * XAVGCj) / (i  j)
If you combine the XAVGC i terms, you get the following.
(j  1) * (XAVGCj  XAVGCi) / (i  j)
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 12/27/2013 Posts: 152

I mean you should write the exponential moving average with period,k, of (XAVGCi  XAVG(XAVGCi, j)) as a whole.


Worden Trainer
Joined: 10/7/2004 Posts: 64,491

Well in TC2000 v18, you could just write this as follows.
XAVG(XAVGCi  XAVG(XAVGCi, j), k)
You could eliminate the nested moving averages as follows.
(j  1) * (((k  1) * XAVGCk  (j  1) * XAVGCj) / (k  j)  ((k  1) * XAVGCk  (i  1) * XAVGCi) / (k  i)) / (i  j)
If you combine the XAVGCk terms you get the following.
(j  1) * (((j  i) * (k  1) * XAVGCk  (k  i) * (j  1) * XAVGCj + (k  j) * (i  1) * XAVGCi)) / (i  j) / (k  j) / (k  i)
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 12/27/2013 Posts: 152

But I am using freestockcharts.com.Will it work well in freestockcharts.com?


Worden Trainer
Joined: 10/7/2004 Posts: 64,491

No, the first formula template would not work in FSC. You can however use either of the other formula templates in the post. The third should be slightly more efficient than the second despite being longer, especially if you are creating a formula and just calculate all of the factors before you enter the formula into the program.
Bruce Personal Criteria Formulas TC2000 Support Articles


Guest1 