Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 4/11/2008 Posts: 10
|
I want to write a PCF for a new scan but I have problems with one condition. I have browsed all related topics and none of them is a perfect answer for what I'm looking for, that is, a pcf for detecting a minor bullish trend in a MACD histogram, in other words, no matter where the present position is, below or above zero, today's bar must be higher than yesterday's bar
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Welcome to the forums. A very good foundation for learning how to use TeleChart can be gained by reviewing the following:
If you are new to TeleChart READ THIS FIRST!
The formula would depend on your specific MACD settings (you haven't specified the first four in your request):
- Short: ?
- Long: ?
- Pereiod: ?
- Average Type: Simple or Exponential?
- Plot MACD as Histogram: Checked
The techniques described in Understanding MACD can be used to write your formula fairly easily once these settings are known. For example for an Exponential MACD 12,26,9 Histogram, one way to write the formula would be:
XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) > XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) + XAVG(XAVGC26.1,9)
This can be shortened somewhat using the techniques described in Cascades of Moving Averages to:
119 * C + 765 * XAVGC12.1 > 65 * XAVGC26.1 + 819 * XAVGC9.1
You may wish to review the following:
How to create a Personal Criteria Forumula (PCF)
Using EasyScan to find stocks that meet your own criteria
PCF Formula Descriptions
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/11/2008 Posts: 10
|
Thank you for your reply! Yes, I realized I had not been too clear only after I had posted my question. Been using Telechart for about one month, only I had not needed to post a question, browsing the forum had answered all my questions until last night! Here are the specific conditions:
- Long
- Daily Chart
- Exponential
- 10,30,5 (Works better for me)
I found the formula you posted later on last night and made the following formula, which worked very well for my purposes, not really on the MACD histogram when browsing the 20 plus selected stocks, but when looking at the price chart, just what I wanted!
(XAVGC10 - XAVGC30) - (XAVG(XAVGC30,10) - XAVG(XAVGC30,5)) > (XAVGC10.1 - XAVGC30.1) - (XAVG(XAVGC30.1,10) - XAVG(XAVGC30.1,5)) AND (XAVGC10.1 - XAVGC30.1) - (XAVG(XAVGC30.1,10) - XAVG(XAVGC30.1,5)) < (XAVGC10.2 - XAVGC30.2) - (XAVG(XAVGC30.2,10) - XAVG(XAVGC30.2,5))
Javier
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Your formula is actually for a deflection (although it has a 30,10 where there should be a 10,5). In other words, the MACD Histogram was going down and is now going up. If you just want to test for the MACD Histogram going up, you could eliminate the second half of the formula (the part after the AND):
XAVGC10 - XAVGC30 - XAVG(XAVGC10,5) + XAVG(XAVGC30,5) > XAVGC10.1 - XAVGC30.1 - XAVG(XAVGC10.1,5) + XAVG(XAVGC30.1,5)
Which can be shortened to:
250 * C + 465 * XAVGC10.1 > 33 * XAVGC30.1 + 682 * XAVGC5.1
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/11/2008 Posts: 10
|
Thank you, I guess I was looking for a deflection indeed, not for a MACD already in a bullish trend, how would you write the formula for such a deflection?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You would add back the portion after the AND (with the corrections already noted):
XAVGC10 - XAVGC30 - XAVG(XAVGC10,5) + XAVG(XAVGC30,5) > XAVGC10.1 - XAVGC30.1 - XAVG(XAVGC10.1,5) + XAVG(XAVGC30.1,5) AND XAVGC10.1 - XAVGC30.1 - XAVG(XAVGC10.1,5) + XAVG(XAVGC30.1,5) < XAVGC10.2 - XAVGC30.2 - XAVG(XAVGC10.2,5) + XAVG(XAVGC30.2,5)
Which can be shortened to:
250 * C + 465 * XAVGC10.1 > 33 * XAVGC30.1 + 682 * XAVGC5.1 AND 250 * C1 + 465 * XAVGC10.2 < 33 * XAVGC30.2 + 682 * XAVGC5.2
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/11/2008 Posts: 10
|
Thank you, it works fine. Where can I find the explanation about how to short the initial formula down to the last formula?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The techniques used are outlined in Cascades of Moving Averages. There are actually a lot of steps involved in the math. A more detailed explanation that is specific to MACD is outlined in bustermu's Thursday, March 30, 2006 10:52:02 AM ET post in MACD 50,21,10 regression and general optimization issues.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |