Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Need help creating a few PCFs for a breakout EasyScan Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
nberman
Posted : Thursday, June 14, 2012 3:34:36 PM
Registered User
Joined: 11/14/2004
Posts: 2

I want to be able to scan for stocks, and the scan needs to include the following four conditions:

  • The DPO(20) on the current bar is positive.
  • The MACD(12,26,9) on the current bar is positive.
  • The price is above the weighted moving average.
  • One or more of the previous three conditions was not true one bar ago.

New to this language, could anyone help me write the corresponding PCFs?

Bruce_L
Posted : Thursday, June 14, 2012 9:24:37 PM


Worden Trainer

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

A Condition Formula for TC2000's 20-Period Detrended Price Oscillator (DPO) being above zero could be written as:

C > AVGC20.11

A Condition Formula for an Exponential MACD 12,26 being above zero could be written as:

XAVGC12 > XAVGC26

A Condition Formula for an Exponential MACD Histogram 12,26,9 being above zero could be written as:

XAVGC12 + XAVG(XAVGC26,9) > XAVGC12 + XAVG(XAVGC12,9)

A Condition Formula for Price being above its Front Weighted Moving Average would depend on the period of the Front Weighted Moving Average. For example, a Condition Formula for Price being above its 5-Period Front Weighted Moving Average could be written as:

C > (5 * C + 4 * C1 + 3 * C2 + 2 * C3 + C4) / 15

Combining these into a single formula which checks for all three requirements being true during the current bar and at least one of the three requirements isn't true during the previous bar would depend on if you are interested in the raw MACD or MACD Histogram and the period of the Front Weighted Moving Average.

If you were interested in the raw MACD and a 5-Period Simple Moving Average, the Condition Formula could be written as:

C > AVGC20.11 AND XAVGC12 > XAVGC26 AND C > (5 * C + 4 * C1 + 3 * C2 + 2 * C3 + C4) / 15 AND (C1 <= AVGC20.12 OR XAVGC12.1 <= XAVGC26.1 OR C1 <= (5 * C1 + 4 * C2 + 3 * C3 + 2 * C4 + C5) / 15)

PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
nberman
Posted : Friday, June 15, 2012 10:26:54 AM
Registered User
Joined: 11/14/2004
Posts: 2

Wow that was fast.  Thanks, Bruce!

thekubiaks
Posted : Friday, November 16, 2012 10:21:55 AM
Registered User
Joined: 2/13/2005
Posts: 368

Bruce,  Are you saying that the Detrended price Oscillator is just a moving average with an 11 day lookback??  Thanks

QUOTE (Bruce_L)

A Condition Formula for TC2000's 20-Period Detrended Price Oscillator (DPO) being above zero could be written as:

C > AVGC20.11

Bruce_L
Posted : Friday, November 16, 2012 10:53:18 AM


Worden Trainer

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

It is actually the close minus an offset moving average of the close. There is no universal agreement on if the price or moving average should be offset or even if the plot should extend all the way to the right of the chart.

There is an extensive discussion of this in the Detrended Price Oscillator topic. The version being used in TC2000 subtracts a Simple Moving Average with the same Period as the Period of the DPO from the current price with the moving average being offset (Period / 2) + 1 bars.



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