BB Touch Rate this Topic:
 Previous Topic · Next Topic Watch this topic · Print this topic ·
0002ct
 Posted : Thursday, September 21, 2017 4:10:19 PM
Gold Customer

Joined: 11/19/2015
Posts: 447

Hello.

Does:
COUNTTRUE(XDOWN(C, BBBOT(2, 20)), 300)

include "touches" where the lower bound is touched (equalled) but not crossed?

Thank you.

Bruce_L
 Posted : Thursday, September 21, 2017 4:21:58 PM

Worden Trainer

Joined: 10/7/2004
Posts: 64,759

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
0002ct
 Posted : Thursday, September 21, 2017 4:31:58 PM
Gold Customer

Joined: 11/19/2015
Posts: 447

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

email2norman
 Posted : Thursday, September 21, 2017 5:36:35 PM
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

Bruce_L
 Posted : Friday, September 22, 2017 8:23:29 AM

Worden Trainer

Joined: 10/7/2004
Posts: 64,759

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)

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
email2norman
 Posted : Friday, September 22, 2017 11:32:17 AM
Registered User
Joined: 12/27/2013
Posts: 152

will it work well in freestockcharts.com?

Bruce_L
 Posted : Friday, September 22, 2017 11:47:22 AM

Worden Trainer

Joined: 10/7/2004
Posts: 64,759

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
0002ct
 Posted : Friday, September 22, 2017 1:29:09 PM
Gold Customer

Joined: 11/19/2015
Posts: 447

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

Bruce_L
 Posted : Friday, September 22, 2017 1:54:48 PM

Worden Trainer

Joined: 10/7/2004
Posts: 64,759

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
0002ct
 Posted : Friday, September 22, 2017 2:04:18 PM
Gold Customer

Joined: 11/19/2015
Posts: 447

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

email2norman
 Posted : Friday, September 22, 2017 3:12:34 PM
Registered User
Joined: 12/27/2013
Posts: 152

Thank you.

email2norman
 Posted : Tuesday, October 03, 2017 11:53:59 AM
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)

Bruce_L
 Posted : Tuesday, October 03, 2017 12:32:08 PM

Worden Trainer

Joined: 10/7/2004
Posts: 64,759

`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
email2norman
 Posted : Saturday, November 25, 2017 4:14:02 PM
Registered User
Joined: 12/27/2013
Posts: 152

(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.

Bruce_L
 Posted : Monday, November 27, 2017 10:58:02 AM

Worden Trainer

Joined: 10/7/2004
Posts: 64,759

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
email2norman
 Posted : Thursday, November 30, 2017 4:30:46 PM
Registered User
Joined: 12/27/2013
Posts: 152

Thank you Bruce

email2norman
 Posted : Thursday, July 12, 2018 3:55:28 AM
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))
Bruce_L
 Posted : Thursday, July 12, 2018 10:13:21 AM

Worden Trainer

Joined: 10/7/2004
Posts: 64,759

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
email2norman
 Posted : Thursday, July 12, 2018 3:58:42 PM
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.
Bruce_L
 Posted : Thursday, July 12, 2018 4:27:44 PM

Worden Trainer

Joined: 10/7/2004
Posts: 64,759

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
email2norman
 Posted : Thursday, July 12, 2018 6:27:20 PM
Registered User
Joined: 12/27/2013
Posts: 152

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

Bruce_L
 Posted : Friday, July 13, 2018 8:27:09 AM

Worden Trainer

Joined: 10/7/2004
Posts: 64,759

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
Users browsing this topic
Guest-1

 Forum Jump Customer Training & Support - Ask a Trainer - TC2000 version 12/18 - Ask a Trainer - TC2000 version 7 - Ask a Trainer - StockFinder 5.0 - PCFs, EasyScan and Custom Indicators General Discussions - Stock and Market Talk - TC2000 version 12 or 18 - TC2000 version 7 - StockFinder 5.0 - RealCode for StockFinder 5.0 Tutorial Videos - TC2000 version 12 tutorial videos - TC2000 version 7 tutorial videos 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.