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 |

Combine PCFs Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
toychin
Posted : Thursday, February 2, 2017 6:17:57 PM
Registered User
Joined: 12/10/2011
Posts: 11

Could you write a custom scan PCF to combine two MACD settings and when either criteria is met, lists the stocks that are at new highs?

MACD setting 5,8,3  and "OR"

MACD setting 12,26,13

If the time frame is not variable, write them for monthly, weekly and daily time frames.

 

toychin
Posted : Thursday, February 2, 2017 8:03:27 PM
Registered User
Joined: 12/10/2011
Posts: 11

The time periods are as follows

monthly 36

weekly 52

daily 130 

Bruce_L
Posted : Friday, February 3, 2017 9:21:22 AM


Worden Trainer

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

You can change the time frame of a PCF, but if you are using different new high periods in each time frame, then you will need a different PCF for each time frame.

Is the new high for the raw MACD, the MACD histogram, price or something else?

If the new high is not for the MACD or MACD histogram, what specifically are we testing about the MACD or MACD histogram in addition to checking for the new high?



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
toychin
Posted : Friday, February 3, 2017 3:02:17 PM
Registered User
Joined: 12/10/2011
Posts: 11

MACD histogram for both settings for 36 periods (583) OR (12,26,9) with  either MACD reaching new highs on the monthly time frame. When created from chart it does not have OR since it i watchng for both o meet the criteria.I like to see stocks when one meets the critera in either seting.

Bruce_L
Posted : Friday, February 3, 2017 3:18:49 PM


Worden Trainer

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

We probably aren't going to be able to do this for TC2000 v12.5 on a Mac.

The best you could add the MACD Histograms to the chart, click on them and select Create Scan Condition to create your New High conditions. But as you have already noted, you end up with two conditions with no way to OR the conditions together.

If you are willing to use emulation or virtualization or your Mac in order to run TC2000 v17 as a Windows program, you could create Condition Formulas for this. The following would be an example of the monthly formula checking for a new 36 bar high in either the exponential MACD histogram 5,8,3 or the exponential MACD histogram 12,26,9.

MACD(5, 8) - XAVG(MACD(5, 8), 3) > MAX(MACD(5, 8, 1) - XAVG(MACD(5, 8, 1), 3), 35) OR MACD(12, 26) - XAVG(MACD(12, 26), 9) > MAX(MACD(12, 26, 1) - XAVG(MACD(12, 26, 1), 9), 35)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
toychin
Posted : Friday, February 3, 2017 3:24:48 PM
Registered User
Joined: 12/10/2011
Posts: 11


Could you write it for the raw MACD?

Bruce_L
Posted : Friday, February 3, 2017 3:35:31 PM


Worden Trainer

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

The same limitations are going to apply to TC2000 v12.5 in that it really can't be done.

The formula for TC2000 v17 could be written as follows.

MACD(5, 8) > MAX(MACD(5, 8, 1), 35) OR MACD(12, 26) > MAX(MACD(12, 26, 1), 35)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
toychin
Posted : Wednesday, February 8, 2017 7:10:36 PM
Registered User
Joined: 12/10/2011
Posts: 11

I appreciate if you could write the first of the two formulas that you provided for the opposite direction, recognizing new MACD lows.

 

Bruce_L
Posted : Wednesday, February 8, 2017 8:19:35 PM


Worden Trainer

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

It is just a matter of changing the < signs to > signs and MAX to MIN. So the first formula becomes the following.

MACD(5, 8) - XAVG(MACD(5, 8), 3) < MIN(MACD(5, 8, 1) - XAVG(MACD(5, 8, 1), 3), 35) OR MACD(12, 26) - XAVG(MACD(12, 26), 9) < MIN(MACD(12, 26, 1) - XAVG(MACD(12, 26, 1), 9), 35)

And the second formula becomes the following.

MACD(5, 8) < MIN(MACD(5, 8, 1), 35) OR MACD(12, 26) < MIN(MACD(12, 26, 1), 35)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
toychin
Posted : Saturday, February 11, 2017 1:35:18 PM
Registered User
Joined: 12/10/2011
Posts: 11

Thank you for the monthly formulas.

Sticking to the MACD histogram (5,8,3) OR (12,26,9) could you write the formulas for new MACD high and lows based on -

52 week period 

130 day period

markhike
Posted : Saturday, February 11, 2017 4:35:05 PM
Registered User
Joined: 5/23/2006
Posts: 75

Hi Bruce, where can I find the PCF enhancements for V17?

 

Bruce_L
Posted : Monday, February 13, 2017 11:47:35 AM


Worden Trainer

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

A list of the new syntax is available in the Version 17 PCF Capabilities topic.

You really can't write formulas for new highs or new lows in the MACD histogram in TC2000 prior to v17 (at least not for 52 or 130 period highs and lows).

So a new 52 period high in the MACD histogram (5,8,3) or (12,26,9) can be written as follows in TC2000 v17.

MACD5.8 - XAVG(MACD5.8, 3) > MAX(MACD5.8.1 - XAVG(MACD5.8.1, 3), 51) OR MACD12.26 - XAVG(MACD12.26, 9) > MAX(MACD12.26.1 - XAVG(MACD12.26.1, 9), 51)

A new 52 period low in the MACD histogram (5,8,3) or (12,26,9) can be written as follows.

MACD5.8 - XAVG(MACD5.8, 3) < MIN(MACD5.8.1 - XAVG(MACD5.8.1, 3), 51) OR MACD12.26 - XAVG(MACD12.26, 9) < MIN(MACD12.26.1 - XAVG(MACD12.26.1, 9), 51)

A new 130 period high in the MACD histogram (5,8,3) or (12,26,9) can be written as follows.

MACD5.8 - XAVG(MACD5.8, 3) > MAX(MACD5.8.1 - XAVG(MACD5.8.1, 3), 129) OR MACD12.26 - XAVG(MACD12.26, 9) > MAX(MACD12.26.1 - XAVG(MACD12.26.1, 9), 129)

And a new 52 period low in the MACD histogram (5,8,3) or (12,26,9) can be written as follows.

MACD5.8 - XAVG(MACD5.8, 3) < MIN(MACD5.8.1 - XAVG(MACD5.8.1, 3), 129) OR MACD12.26 - XAVG(MACD12.26, 9) < MIN(MACD12.26.1 - XAVG(MACD12.26.1, 9), 129)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
markhike
Posted : Tuesday, February 14, 2017 12:03:56 AM
Registered User
Joined: 5/23/2006
Posts: 75

Thanks Bruce!

Very impressive improvements and now we can truly do some creative coding!

Bruce_L
Posted : Tuesday, February 14, 2017 9:05:02 AM


Worden Trainer

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

You're welcome.



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