Registered User Joined: 12/2/2004 Posts: 15
|
I'm trying to create a PCF where price is above the 20ema and the 20ema is at or above the 50ema and the 50ema is at or above the 200ema. Here's what I came up with but my sort when using this does not produce what I'm looking for. Can someone help please?
C > (XAVGC20 > XAVGC50 AND C > XAVGC200)
Also if I was looking for a timeframe where the 20ema has been at or above the 50ema which has been at or above the 200 ema for a period of 10 (maybe 20 days) how would I modify my formula?
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
Try this:
C>XAVGC20ANDXAVGC20>XAVGC50ANDXAVGC50>XAVGC200
If you put a true false condition inside the ABS() function it will equal 1 if true and 0 if false. You can use this to "count" the days.
ABS(XAVGC20>XAVGC50ANDXAVGC50>XAVGC200)
(today's value)
ABS(XAVGC20.1>XAVGC50.1ANDXAVGC50.1>XAVGC200.1)
(yesterdays value)
If you do that for 10 days. You will get the count you need.
ABS(today)+ABS(yesterday)+ABS(the day before yesterday) and so on.
When it equals zero the condition in not true. When it equals 3 the condition has been true for 3 days. When it equals 10 you will have the stocks that have been rue for 10 days.
Thanks diceman
|