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 Bands and MACD Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
couto7
Posted : Monday, July 21, 2014 5:21:57 PM
Gold Customer Gold Customer

Joined: 10/14/2004
Posts: 202

Bruce-

Please write a PCF for the following: Scan for stocks only, no ETFs

Entry Trigger:

Price has crossed above the upper (1 standard deviation; 20 day look back period) Bollinger Band in the last 2 days. And the 20 day MACD has crossed above the zero line within the last 1 day period.

Exit Trigger:

Price has crossed below the upper (1 standard deviation; 20 day look back period) Bollinger Band in the last 2 days.  And the 9 day MACD has crossed below the zero line within the last 1 day period.

 

Bruce_L
Posted : Tuesday, July 22, 2014 10:01:49 AM


Worden Trainer

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

A Condition Formula for price being above the Upper Bollinger Band 20, 1 during the current bar but below 2-bars ago in TC2000 verison 7 can be written as follows.

C > AVGC20 + 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) AND C2 < AVGC20.2 + SQR(ABS(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 + C20 ^ 2 + C21 ^ 2 - 20 * AVGC20.2 ^ 2) / 19)

A Condition Formula for price being below the Upper Bollinger Band 20, 1 during the current bar but above 2-bars ago in TC2000 verison 7 can be written as follows.

C < AVGC20 + 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) AND C2 > AVGC20.2 + SQR(ABS(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 + C20 ^ 2 + C21 ^ 2 - 20 * AVGC20.2 ^ 2) / 19)

Modelling Bollinger Bands (& Standard Deviation) in a TC PCF

That said, I do not know what you mean by a 20 day MACD or a 9 day MACD. The plain MACD normally requires two parameters to plot and the MACD trigger or MACD Histogram normally require 3 parameters. You also need to know if the MACD is simple or exponential.

Understanding MACD



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
couto7
Posted : Tuesday, July 22, 2014 11:59:48 AM
Gold Customer Gold Customer

Joined: 10/14/2004
Posts: 202

Bruce-

Sorry for the confusion. Instead of the earlier parameters for the MACD, please write a PCF for the MACD (6 EMA and 19 EMA) combo with the 6 EMA crossing above the 19 EMA which is Bullish.

Also, a PCF for the MACD using the (19 EMA and 39 EMA) combo with the 19 EMA crossing below the 39 EMA which is Bearish. 

Bruce_L
Posted : Tuesday, July 22, 2014 12:17:31 PM


Worden Trainer

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

A Condition Formula for price being above the Upper Bollinger Band 20, 1 during the current bar but below 2-bars ago and EMA6 crossing above EMA19 in TC2000 verison 7 can be written as follows

C > AVGC20 + 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) AND C2 < AVGC20.2 + SQR(ABS(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 + C20 ^ 2 + C21 ^ 2 - 20 * AVGC20.2 ^ 2) / 19) AND XAVGC9 > XAVGC19 AND XAVGC9.1 <= XAVGC19.1

A Condition Formula for price being below the Upper Bollinger Band 20, 1 during the current bar but above 2-bars ago and EMA19 crossing below EMA39 in TC2000 verison 7 can be written as follows.

C < AVGC20 + 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) AND C2 > AVGC20.2 + SQR(ABS(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 + C20 ^ 2 + C21 ^ 2 - 20 * AVGC20.2 ^ 2) / 19) AND XAVGC19 < XAVGC39 AND XAVGC19.1 >= XAVGC39.1



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