Registered User Joined: 10/10/2004 Posts: 62
|
Bruce : Is it possible to create a PCF where MACD Histigram ( 12.26.9 Exp.) is close to the Zero line , that is , a little above , a little below, or at the zero line. I am not sure how to define "little" or "close". Could it be a percentage ?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It really can't be a percentage of itself since it crosses through zero. You might be able to make it a percentage of say the 26-Period Moving Average since it should always be positive for stocks. So if you wanted it to be within 1% of the 26-Period Moving Average of the zero line:
100 * ABS((XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9)) / XAVGC26 - 1) <= 1
How to create a Personal Criteria Forumula (PCF)
Understanding MACD
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/10/2004 Posts: 62
|
Bruce: Is there a way to write a PCF that EXCLUDES stocks where MACD(12,26,9 exp.) histogrami is equal to or below zero , and at the SAME TIME the histogram is fallining or decreasing compared to the day before. The objective is that the stocks with MACD histograms below zero with simultaneously rising or increasing histograms (compared to the day before) would not be excluded .Also the PCF opposite of this that EXCLUDES stocks where the histogram is zero or above and rising compared to the day before but does not exclude stocks where the histogram is equal to or above zere with falling or decreasing histogram.
Thaks, mfg
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
QUOTE (mfg) Is there a way to write a PCF that EXCLUDES stocks where MACD(12,26,9 exp.) histogrami is equal to or below zero , and at the SAME TIME the histogram is fallining or decreasing compared to the day before.
If you want to return all symbols where the MACD Histogram is above zero and decreasing (exclude the first but include the second):
XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) > 0 AND XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) < XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) + XAVG(XAVGC26.1,9)
If you want to return all symbols where the MACD Histogram is above zero and either flat or increasing (exclude both the first and second):
XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) > 0 AND XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) >= XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) + XAVG(XAVGC26.1,9)
QUOTE (mfg) The objective is that the stocks with MACD histograms below zero with simultaneously rising or increasing histograms (compared to the day before) would not be excluded .
If you want to return all symbols where the MACD Histogram is below zero and increasing:
XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) < 0 AND XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) > XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) + XAVG(XAVGC26.1,9)
QUOTE (mfg) Also the PCF opposite of this that EXCLUDES stocks where the histogram is zero or above and rising compared to the day before...
If you want to return all symbols where the MACD Histogram is below zero and increasing (exclude the first but include the second):
XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) < 0 AND XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) > XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) + XAVG(XAVGC26.1,9)
If you want to return all symbols where the MACD Histogram is above zero and either flat or decreasing (exclude both the first and second):
XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) > 0 AND XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) <= XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) + XAVG(XAVGC26.1,9)
QUOTE (mfg) ...but does not exclude stocks where the histogram is equal to or above zere with falling or decreasing histogram.
If you want to return all symbols where the MACD Histogram is at or above zero and decreasing:
XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) >= 0 AND XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) < XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) + XAVG(XAVGC26.1,9)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/10/2004 Posts: 62
|
Worked fine , thank you Bruce
|
|
Registered User Joined: 10/10/2004 Posts: 62
|
Bruce,
Need your help with a PCF for OSMA ( Oscillator of Moving Averages), in Telechart. The formula for OSMA in Metastock is:
Pds:=Input("Signal Periods",1,99,9);
0;
MACD()-Mov(MACD(),9,E);
Also , if possible, a PCF for a buy and a sell easy-scan when the indicator touches or crosses the zero line from below for buy, and when it touches or crosses the zero line from above for sell.
Thank you,
mfg
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If the articles I'm reading on the internet are correct, the OSMA is based on the raw MACD and not the MACD Histogram. So the OSMA is just the MACD Histogram. If this is true, a Condition Formula for your buy could be written as:
XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) >= 0 AND XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) + XAVG(XAVGC26.1,9) < 0
While a Condition Formula for your sell could be written as:
XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) <= 0 AND XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) + XAVG(XAVGC26.1,9) > 0
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/10/2004 Posts: 62
|
Bruce,
Could you help with with PCF of DEMA MACD (Dinapoli), also crossover up and down scans PCFs; The Metastock formula is:
A:=(Mov(C,8.3896,E)-Mov(C,17.5185,E));
Sig:=Mov(A,9.0503,E);
0;Sig;A;
Thank you.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Are you sure that is the correct formula for the desired DEMA MACD?
Setting up a DEMA MACD
I ask because it just appears to be a regular MACD using non-integer periods.
For the raw MACD 8.3896, 17.5185 I get:
.2132068 * (C + .7869984 * (C1 + .7869984 * (C2 + .7869984 * (C3 + .7869984 * (C4 + .7869984 * (C5 + .7869984 * (C6 + .7869984 * (C7 + .7869984 * (C8 + .7869984 * (C9 + .7869984 * (C10 + .7869984 * (C11 + .7869984 * (C12 + .7869984 * (C13 + .7869984 * (C14 + .7869984 * (C15 + .7869984 * (C16 + .7869984 * (C17 + .7869984 * (C18 + .7869984 * (C19 + .7869984 * (C20 + .7869984 * (C21 + .7869984 * (C22 + .7869984 * (C23 + .7869984 * (C24 + .7869984 * (C25 + .7869984 * (C26 + .7869984 * (C27 + .7869984 * (C28))))))))))))))))))))))))))))) - .1081015 * (C + .8919999 * (C1 + .8919999 * (C2 + .8919999 * (C3 + .8919999 * (C4 + .8919999 * (C5 + .8919999 * (C6 + .8919999 * (C7 + .8919999 * (C8 + .8919999 * (C9 + .8919999 * (C10 + .8919999 * (C11 + .8919999 * (C12 + .8919999 * (C13 + .8919999 * (C14 + .8919999 * (C15 + .8919999 * (C16 + .8919999 * (C17 + .8919999 * (C18 + .8919999 * (C19 + .8919999 * (C20 + .8919999 * (C21 + .8919999 * (C22 + .8919999 * (C23 + .8919999 * (C24 + .8919999 * (C25 + .8919999 * (C26 + .8919999 * (C27 + .8919999 * (C28 + .8919999 * (C29 + .8919999 * (C30 + .8919999 * (C31 + .8919999 * (C32 + .8919999 * (C33 + .8919999 * (C34 + .8919999 * (C35 + .8919999 * (C36 + .8919999 * (C37 + .8919999 * (C38 + .8919999 * (C39 + .8919999 * (C40 + .8919999 * (C41 + .8919999 * (C42 + .8919999 * (C43 + .8919999 * (C44 + .8919999 * (C45 + .8919999 * (C46 + .8919999 * (C47 + .8919999 * (C48 + .8919999 * (C49 + .8919999 * (C50 + .8919999 * (C51 + .8919999 * (C52 + .8919999 * (C53 + .8919999 * (C54 + .8919999 * (C55 + .8919999 * (C56 + .8919999 * (C57 + .8919999 * (C58 + .8919999 * (C59 + .8919999 * (C60)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
With the 9.0503-Period Exponential Moving Average of that being:
2.61604 * (C + .801001 * (C1 + .801001 * (C2 + .801001 * (C3 + .801001 * (C4 + .801001 * (C5 + .801001 * (C6 + .801001 * (C7 + .801001 * (C8 + .801001 * (C9 + .801001 * (C10 + .801001 * (C11 + .801001 * (C12 + .801001 * (C13 + .801001 * (C14 + .801001 * (C15 + .801001 * (C16 + .801001 * (C17 + .801001 * (C18 + .801001 * (C19 + .801001 * (C20 + .801001 * (C21 + .801001 * (C22 + .801001 * (C23 + .801001 * (C24 + .801001 * (C25 + .801001 * (C26 + .801001 * (C27 + .801001 * (C28 + .801001 * (C29 + .801001 * (C30 + .801001 * (C31)))))))))))))))))))))))))))))))) - 2.384611 * (C + .7869984 * (C1 + .7869984 * (C2 + .7869984 * (C3 + .7869984 * (C4 + .7869984 * (C5 + .7869984 * (C6 + .7869984 * (C7 + .7869984 * (C8 + .7869984 * (C9 + .7869984 * (C10 + .7869984 * (C11 + .7869984 * (C12 + .7869984 * (C13 + .7869984 * (C14 + .7869984 * (C15 + .7869984 * (C16 + .7869984 * (C17 + .7869984 * (C18 + .7869984 * (C19 + .7869984 * (C20 + .7869984 * (C21 + .7869984 * (C22 + .7869984 * (C23 + .7869984 * (C24 + .7869984 * (C25 + .7869984 * (C26 + .7869984 * (C27 + .7869984 * (C28))))))))))))))))))))))))))))) - .2108683 * (C + .8919999 * (C1 + .8919999 * (C2 + .8919999 * (C3 + .8919999 * (C4 + .8919999 * (C5 + .8919999 * (C6 + .8919999 * (C7 + .8919999 * (C8 + .8919999 * (C9 + .8919999 * (C10 + .8919999 * (C11 + .8919999 * (C12 + .8919999 * (C13 + .8919999 * (C14 + .8919999 * (C15 + .8919999 * (C16 + .8919999 * (C17 + .8919999 * (C18 + .8919999 * (C19 + .8919999 * (C20 + .8919999 * (C21 + .8919999 * (C22 + .8919999 * (C23 + .8919999 * (C24 + .8919999 * (C25 + .8919999 * (C26 + .8919999 * (C27 + .8919999 * (C28 + .8919999 * (C29 + .8919999 * (C30 + .8919999 * (C31 + .8919999 * (C32 + .8919999 * (C33 + .8919999 * (C34 + .8919999 * (C35 + .8919999 * (C36 + .8919999 * (C37 + .8919999 * (C38 + .8919999 * (C39 + .8919999 * (C40 + .8919999 * (C41 + .8919999 * (C42 + .8919999 * (C43 + .8919999 * (C44 + .8919999 * (C45 + .8919999 * (C46 + .8919999 * (C47 + .8919999 * (C48 + .8919999 * (C49 + .8919999 * (C50 + .8919999 * (C51 + .8919999 * (C52 + .8919999 * (C53 + .8919999 * (C54 + .8919999 * (C55 + .8919999 * (C56 + .8919999 * (C57 + .8919999 * (C58 + .8919999 * (C59 + .8919999 * (C60)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
And the MACD Histogram 8.3896, 17.5185, 9.0503 being:
2.597818 * (C + .7869984 * (C1 + .7869984 * (C2 + .7869984 * (C3 + .7869984 * (C4 + .7869984 * (C5 + .7869984 * (C6 + .7869984 * (C7 + .7869984 * (C8 + .7869984 * (C9 + .7869984 * (C10 + .7869984 * (C11 + .7869984 * (C12 + .7869984 * (C13 + .7869984 * (C14 + .7869984 * (C15 + .7869984 * (C16 + .7869984 * (C17 + .7869984 * (C18 + .7869984 * (C19 + .7869984 * (C20 + .7869984 * (C21 + .7869984 * (C22 + .7869984 * (C23 + .7869984 * (C24 + .7869984 * (C25 + .7869984 * (C26 + .7869984 * (C27 + .7869984 * (C28))))))))))))))))))))))))))))) + .1027668 * (C + .8919999 * (C1 + .8919999 * (C2 + .8919999 * (C3 + .8919999 * (C4 + .8919999 * (C5 + .8919999 * (C6 + .8919999 * (C7 + .8919999 * (C8 + .8919999 * (C9 + .8919999 * (C10 + .8919999 * (C11 + .8919999 * (C12 + .8919999 * (C13 + .8919999 * (C14 + .8919999 * (C15 + .8919999 * (C16 + .8919999 * (C17 + .8919999 * (C18 + .8919999 * (C19 + .8919999 * (C20 + .8919999 * (C21 + .8919999 * (C22 + .8919999 * (C23 + .8919999 * (C24 + .8919999 * (C25 + .8919999 * (C26 + .8919999 * (C27 + .8919999 * (C28 + .8919999 * (C29 + .8919999 * (C30 + .8919999 * (C31 + .8919999 * (C32 + .8919999 * (C33 + .8919999 * (C34 + .8919999 * (C35 + .8919999 * (C36 + .8919999 * (C37 + .8919999 * (C38 + .8919999 * (C39 + .8919999 * (C40 + .8919999 * (C41 + .8919999 * (C42 + .8919999 * (C43 + .8919999 * (C44 + .8919999 * (C45 + .8919999 * (C46 + .8919999 * (C47 + .8919999 * (C48 + .8919999 * (C49 + .8919999 * (C50 + .8919999 * (C51 + .8919999 * (C52 + .8919999 * (C53 + .8919999 * (C54 + .8919999 * (C55 + .8919999 * (C56 + .8919999 * (C57 + .8919999 * (C58 + .8919999 * (C59 + .8919999 * (C60))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) - 2.61604 * (C + .801001 * (C1 + .801001 * (C2 + .801001 * (C3 + .801001 * (C4 + .801001 * (C5 + .801001 * (C6 + .801001 * (C7 + .801001 * (C8 + .801001 * (C9 + .801001 * (C10 + .801001 * (C11 + .801001 * (C12 + .801001 * (C13 + .801001 * (C14 + .801001 * (C15 + .801001 * (C16 + .801001 * (C17 + .801001 * (C18 + .801001 * (C19 + .801001 * (C20 + .801001 * (C21 + .801001 * (C22 + .801001 * (C23 + .801001 * (C24 + .801001 * (C25 + .801001 * (C26 + .801001 * (C27 + .801001 * (C28 + .801001 * (C29 + .801001 * (C30 + .801001 * (C31))))))))))))))))))))))))))))))))
And the prior MACD Histogram 8.3896, 17.5185, 9.0503 being (for use in crossovers):
2.597818 * (C1 + .7869984 * (C2 + .7869984 * (C3 + .7869984 * (C4 + .7869984 * (C5 + .7869984 * (C6 + .7869984 * (C7 + .7869984 * (C8 + .7869984 * (C9 + .7869984 * (C10 + .7869984 * (C11 + .7869984 * (C12 + .7869984 * (C13 + .7869984 * (C14 + .7869984 * (C15 + .7869984 * (C16 + .7869984 * (C17 + .7869984 * (C18 + .7869984 * (C19 + .7869984 * (C20 + .7869984 * (C21 + .7869984 * (C22 + .7869984 * (C23 + .7869984 * (C24 + .7869984 * (C25 + .7869984 * (C26 + .7869984 * (C27 + .7869984 * (C28 + .7869984 * (C29))))))))))))))))))))))))))))) + .1027668 * (C1 + .8919999 * (C2 + .8919999 * (C3 + .8919999 * (C4 + .8919999 * (C5 + .8919999 * (C6 + .8919999 * (C7 + .8919999 * (C8 + .8919999 * (C9 + .8919999 * (C10 + .8919999 * (C11 + .8919999 * (C12 + .8919999 * (C13 + .8919999 * (C14 + .8919999 * (C15 + .8919999 * (C16 + .8919999 * (C17 + .8919999 * (C18 + .8919999 * (C19 + .8919999 * (C20 + .8919999 * (C21 + .8919999 * (C22 + .8919999 * (C23 + .8919999 * (C24 + .8919999 * (C25 + .8919999 * (C26 + .8919999 * (C27 + .8919999 * (C28 + .8919999 * (C29 + .8919999 * (C30 + .8919999 * (C31 + .8919999 * (C32 + .8919999 * (C33 + .8919999 * (C34 + .8919999 * (C35 + .8919999 * (C36 + .8919999 * (C37 + .8919999 * (C38 + .8919999 * (C39 + .8919999 * (C40 + .8919999 * (C41 + .8919999 * (C42 + .8919999 * (C43 + .8919999 * (C44 + .8919999 * (C45 + .8919999 * (C46 + .8919999 * (C47 + .8919999 * (C48 + .8919999 * (C49 + .8919999 * (C50 + .8919999 * (C51 + .8919999 * (C52 + .8919999 * (C53 + .8919999 * (C54 + .8919999 * (C55 + .8919999 * (C56 + .8919999 * (C57 + .8919999 * (C58 + .8919999 * (C59 + .8919999 * (C60 + .8919999 * (C60))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) - 2.61604 * (C1 + .801001 * (C2 + .801001 * (C3 + .801001 * (C4 + .801001 * (C5 + .801001 * (C6 + .801001 * (C7 + .801001 * (C8 + .801001 * (C9 + .801001 * (C10 + .801001 * (C11 + .801001 * (C12 + .801001 * (C13 + .801001 * (C14 + .801001 * (C15 + .801001 * (C16 + .801001 * (C17 + .801001 * (C18 + .801001 * (C19 + .801001 * (C20 + .801001 * (C21 + .801001 * (C22 + .801001 * (C23 + .801001 * (C24 + .801001 * (C25 + .801001 * (C26 + .801001 * (C27 + .801001 * (C28 + .801001 * (C29 + .801001 * (C30 + .801001 * (C31 + .801001 * (C32))))))))))))))))))))))))))))))))
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/10/2004 Posts: 62
|
Appears to be not much diffrent when decimals are not used, thank for your help in clarification.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |