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.
|
|
Registered User Joined: 12/10/2011 Posts: 11
|
The time periods are as follows
monthly 36
weekly 52
daily 130
|
|
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
|
|
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.
|
|
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
|
|
Registered User Joined: 12/10/2011 Posts: 11
|
Could you write it for the raw MACD?
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
Registered User Joined: 5/23/2006 Posts: 75
|
Hi Bruce, where can I find the PCF enhancements for V17?
|
|
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
|
|
Registered User Joined: 5/23/2006 Posts: 75
|
Thanks Bruce!
Very impressive improvements and now we can truly do some creative coding!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |