Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 3/15/2006 Posts: 12
|
Hi there,
I have my MACD setting at 20,40,30.
Please help me to write a PCF to catch those stocks when MACD20,40 start breaking to upside 10% (with 4 days time frame) from its bottom peak and go toward the MACD30(average moving of MACD20,40).
Thanks,
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I must be misunderstanding something. I started to write a formula and got this far (not sure if it makes much sense yet):
XAVGC20 - XAVGC40 > (XAVGC20.1 - XAVGC40.1 + XAVGC20.2 - XAVGC40.2 - ABS(XAVGC20.1 - XAVGC40.1 - XAVGC20.2 + XAVGC40.2) + XAVGC20.3 - XAVGC40.3 + XAVGC20.4 - XAVGC40.4 - ABS(XAVGC20.3 - XAVGC40.3 - XAVGC20.4 + XAVGC40.4) - ABS(XAVGC20.1 - XAVGC40.1 + XAVGC20.2 - XAVGC40.2 - ABS(XAVGC20.1 - XAVGC40.1 - XAVGC20.2 + XAVGC40.2) - XAVGC20.3 + XAVGC40.3 - XAVGC20.4 + XAVGC40.4 + ABS(XAVGC20.3 - XAVGC40.3 - XAVGC20.4 + XAVGC40.4))) / 4 AND (XAVGC20.5 - XAVGC40.5 + XAVGC20.6 - XAVGC40.6 - ABS(XAVGC20.5 - XAVGC40.5 - XAVGC20.6 + XAVGC40.6) + XAVGC20.7 - XAVGC40.7 + XAVGC20.8 - XAVGC40.8 - ABS(XAVGC20.7 - XAVGC40.7 - XAVGC20.8 + XAVGC40.8) - ABS(XAVGC20.5 - XAVGC40.5 + XAVGC20.6 - XAVGC40.6 - ABS(XAVGC20.5 - XAVGC40.5 - XAVGC20.6 + XAVGC40.6) - XAVGC20.7 + XAVGC40.7 - XAVGC20.8 + XAVGC40.8 + ABS(XAVGC20.7 - XAVGC40.7 - XAVGC20.8 + XAVGC40.8))) / 4 > (XAVGC20.1 - XAVGC40.1 + XAVGC20.2 - XAVGC40.2 - ABS(XAVGC20.1 - XAVGC40.1 - XAVGC20.2 + XAVGC40.2) + XAVGC20.3 - XAVGC40.3 + XAVGC20.4 - XAVGC40.4 - ABS(XAVGC20.3 - XAVGC40.3 - XAVGC20.4 + XAVGC40.4) - ABS(XAVGC20.1 - XAVGC40.1 + XAVGC20.2 - XAVGC40.2 - ABS(XAVGC20.1 - XAVGC40.1 - XAVGC20.2 + XAVGC40.2) - XAVGC20.3 + XAVGC40.3 - XAVGC20.4 + XAVGC40.4 + ABS(XAVGC20.3 - XAVGC40.3 - XAVGC20.4 + XAVGC40.4))) / 4 AND XAVGC20 - XAVGC40 < XAVG(XAVGC20,30) - XAVG(XAVGC40,30)
Before I asked myself what MACD breaking to the upside 10% really means. 10% of what? The MACD could be negative or even zero.... I can't continue without further clarification.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/15/2006 Posts: 12
|
would you like to give me a call at (phone number removed by moderator). I think you may mis-understand my request. By the way, I mean 10% of MACD(20,40) bottom peak.
|
|
Registered User Joined: 3/15/2006 Posts: 12
|
Let me try again to express my request:
My MACD setting is 20,40,30. Let create some conventions:
MA20 : 20 days moving average MA40 : 40 days moving average MA(20,40) : My MACD setting with short = 20, long = 40, period = 1 MA30 : 30 days Moving average of MA(20,40)
Please help me to write a PCF to catch those stocks when MACD(20,40) start breaking to the upside 10% (with 4 days time frame) from its bottom peak and go toward the MA30(30 moving average of MA(20,40)). It is clear for you ??
Thanks,
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I've already indicated I must be misunderstanding something, but training is only provided in the forums. Here's my current understanding of your request (you can point out any misunderstandings):
1. The raw MACD must be coming up from a local minimum. 2. The raw MACD must be approaching the MACD trigger from below. 3. The raw MACD must increase 10% from the local minimum within a 4 period timeframe.
1 and 2 are already incorporated into what I've done so far, which divides the last MACD for the last 9-Periods into 3 segments:
1. Current MACD 2. The 4-Periods immediately prior to 1. 3. The 4-Periods immediately prior to 2 (this can be increased if a 9-Period total timeframe is too short).
1 must be greater than the minimum value of 2 and the minimum value of 3 must be greater than the minimum value of 2. This ensures that the minimum value of 2 is the local minimum and that this minimum occured within a 4-Period timeframe.
The formula so far also tests to make sure the current raw MACD is less than the current MACD trigger to make sure the raw MACD is approaching the MACD trigger from below.
QUOTE (quocpham012172) By the way, I mean 10% of MACD(20,40) bottom peak. This is the part that does not make sense to me (and is why requirement 3, a 10% increase, is not incorporated into what I have so far).
The value of the "MACD(20,40) bottom peak" is already part of the formula as the minimum value of the MACD during the 4-Periods immediately prior to the current MACD. It is a simple enough matter to subtract one from the other and make sure the resulting value is greater than "10% of MACD(20,40) bottom peak" (broken down into its parts):
XAVGC20 - XAVGC40 - (XAVGC20.1 - XAVGC40.1 + XAVGC20.2 - XAVGC40.2 - ABS(XAVGC20.1 - XAVGC40.1 - XAVGC20.2 + XAVGC40.2) + XAVGC20.3 - XAVGC40.3 + XAVGC20.4 - XAVGC40.4 - ABS(XAVGC20.3 - XAVGC40.3 - XAVGC20.4 + XAVGC40.4) - ABS(XAVGC20.1 - XAVGC40.1 + XAVGC20.2 - XAVGC40.2 - ABS(XAVGC20.1 - XAVGC40.1 - XAVGC20.2 + XAVGC40.2) - XAVGC20.3 + XAVGC40.3 - XAVGC20.4 + XAVGC40.4 + ABS(XAVGC20.3 - XAVGC40.3 - XAVGC20.4 + XAVGC40.4))) / 4 > .1 * (XAVGC20.1 - XAVGC40.1 + XAVGC20.2 - XAVGC40.2 - ABS(XAVGC20.1 - XAVGC40.1 - XAVGC20.2 + XAVGC40.2) + XAVGC20.3 - XAVGC40.3 + XAVGC20.4 - XAVGC40.4 - ABS(XAVGC20.3 - XAVGC40.3 - XAVGC20.4 + XAVGC40.4) - ABS(XAVGC20.1 - XAVGC40.1 + XAVGC20.2 - XAVGC40.2 - ABS(XAVGC20.1 - XAVGC40.1 - XAVGC20.2 + XAVGC40.2) - XAVGC20.3 + XAVGC40.3 - XAVGC20.4 + XAVGC40.4 + ABS(XAVGC20.3 - XAVGC40.3 - XAVGC20.4 + XAVGC40.4))) / 4
But the result is pretty useless. If the "MACD(20,40) bottom peak" is negative, the current MACD minus the minimum MACD for the previous 4-Periods will will always be greater since it will always be a positive number.
We could work around this by comparing the absolute value of the "MACD(20,40) bottom peak" instead, but MACD is designed to move through zero. As the MACD approaches zero, you start to run into the same problem. Even the smallest move will be greater than "10% of MACD(20,40) bottom peak".
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |