Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Bollinger band envelope formula: Please convert for TC2000 v.12 Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
tburgin1
Posted : Friday, September 23, 2011 12:19:18 PM
Registered User
Joined: 9/2/2011
Posts: 6

(a)    upperBE=Average(high,n) + m*stdevp(high, n)

(b)   lowerBE= Average(low,n)- m*stdevp(low, n)

(c)    defarult of n=20

(d)   Default for m=1.7 (set to approximately equal the containment characteristics of similar BBs)

(e)   Average can be any type of averages simple, exponential, weighted or gausses.

(f)     Middle Band = (upperBE+lowerBE)/2

Bruce_L
Posted : Friday, September 23, 2011 12:33:54 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The formula for the upper band could be written as:

AVGH20 + 1.7 * SQR(ABS(H ^ 2 + H1 ^ 2 + H2 ^ 2 + H3 ^ 2 + H4 ^ 2 + H5 ^ 2 + H6 ^ 2 + H7 ^ 2 + H8 ^ 2 + H9 ^ 2 + H10 ^ 2 + H11 ^ 2 + H12 ^ 2 + H13 ^ 2 + H14 ^ 2 + H15 ^ 2 + H16 ^ 2 + H17 ^ 2 + H18 ^ 2 + H19 ^ 2 - 20 * AVGH20 ^ 2) / 20)

The formula for the lower band could be written as:

AVGL20 - 1.7 * SQR(ABS(L ^ 2 + L1 ^ 2 + L2 ^ 2 + L3 ^ 2 + L4 ^ 2 + L5 ^ 2 + L6 ^ 2 + L7 ^ 2 + L8 ^ 2 + L9 ^ 2 + L10 ^ 2 + L11 ^ 2 + L12 ^ 2 + L13 ^ 2 + L14 ^ 2 + L15 ^ 2 + L16 ^ 2 + L17 ^ 2 + L18 ^ 2 + L19 ^ 2 - 20 * AVGL20 ^ 2) / 20)

But if you were going to create it as a Channel Indicator, the Indicator Line Formula would be:

(AVGH20 + 1.7 * SQR(ABS(H ^ 2 + H1 ^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personal Criteria Formulas
TC2000 Support Articles
tburgin1
Posted : Friday, September 23, 2011 9:31:51 PM
Registered User
Joined: 9/2/2011
Posts: 6
How do I put a personnal formula on my personnal formaul?  I do I use the formaul to plot it on a price chart?
Bruce_L
Posted : Monday, September 26, 2011 9:07:30 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
There is no way to apply a Personal Criteria Formula to another PCF unless you can manually do the math to create a PCF which combines them.

You can create any of these formulas as an Indicator Formula in TC2000 version 12 by selecting Indicators | New Indicator Formula and then pasting the formula into the Edit PCF window using ctrl-v on the keyboard.

If you want to plot the indicators on Price, I would suggest using the second two formulas given in my original reply. Select Add Indicator | Custom PCF Channel Indicator. Then click in the Custom PCF Channel Indicator to Edit it. There will be boxes in the window where you can put the Indicator Line Formula and Channel Width Formula which were provided above.

Indicators, Sorting & Scanning

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
tburgin1
Posted : Tuesday, September 27, 2011 12:58:53 AM
Registered User
Joined: 9/2/2011
Posts: 6
When the Upper and Lower Bollinger Bands are placed on the Price window there is a problem.  The lower band is sometime higher than the upper band.  I could see after a long steady rpice they could come togreather but not cross.

Is the formual correct for the formual I gave you or the orginal formual incorrect?
Bruce_L
Posted : Tuesday, September 27, 2011 7:56:56 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
It reads like you have tried using the upper band and lower band formulas on the chart as Custom PCF Formulas in TC2000 version 12 instead of using the Indicator Line Formula and Channel Width Formula in a Custom PCF Channel Indicator as suggested.

The Custom PCF Indicator does not currently have a way to scale to the Price History or another non-fixed scale. It is always scaled on its own scale. This means the plots would not be scaled to each other or price. The crossovers are not a result of the values crossing, but of the scales not being aligned.

This is why I suggested using the Custom PCF Channel Indicator instead even though the resulting formulas are longer as it is always scaled to price.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
amullen5190
Posted : Saturday, March 28, 2015 4:51:58 PM
Registered User
Joined: 2/11/2015
Posts: 2

Bruce L:  you are the smartest man alive! THANKS!

Bruce_L
Posted : Monday, March 30, 2015 1:03:41 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Just a note that this is an old topic. It is now possible to scan Custom PCF Indicators with Price in TC2000 version 12.4.

Indicator Scaling (2:38)
Price Scaling (5:46)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
fabo26
Posted : Monday, September 12, 2016 4:11:23 PM
Registered User
Joined: 8/27/2016
Posts: 3

Hi, having problem with PCF for upper-lower bands price  closes above or below, when applied to charts it does not privde consistent result, i.e. price in fact did not cross any line. All I have done added c> or < statement to the formula written above and applied to the CLOSES rather than Highs.

Bruce_L
Posted : Monday, September 12, 2016 4:14:44 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Are you using TC2000 v7 or TC2000 v12/v16? What are the exact settings of your Bollinger Bands?

If TC2000 v7 - Will also need to know parent indicator.
- Period: ?
- Width: ?

If TC2000 v12/v16
- Period: ?
- Std Dev: ?
- Average Type: ?
- Data Source: ?



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
fabo26
Posted : Wednesday, September 14, 2016 9:23:20 AM
Registered User
Joined: 8/27/2016
Posts: 3

Hi, thanks for quick response,

I am using tc2000 v16

period-days

ST dev-2.6

20 day Simple average 

Based on closed prices

Thanks

Bruce_L
Posted : Thursday, September 15, 2016 9:22:46 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Price above top band:

C > AVGC20 + 2.6 * 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) / 20)

Price below bottom band:

C < AVGC20 - 2.6 * SQR(ABS(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2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 ^ 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 + C20 ^ 2 - 20 * AVGC20.1 ^ 2) / 20)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
fabo26
Posted : Friday, September 16, 2016 4:11:04 AM
Registered User
Joined: 8/27/2016
Posts: 3

Thanks Bruce, Top job!!

How can I adopt these formulas to ather time frmaes; h, 4h, weeks

Thanks

Bruce_L
Posted : Friday, September 16, 2016 9:47:20 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

There is a time frame setting available when creating or editing Personal Criteria Formulas in TC2000 v16.

You can also generally change the default time frame setting for the PCF when you use it in a layout. For example, you can click on a PCF when it is used as an EasyScan Condition and manually set the time frame there. This actually allows you to add the same PCF to the same EasyScan more than once with a different time frame used for each instance.



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