Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 9/11/2007 Posts: 28
|
Hi, can you help with a pcf that looks for a 10 day low in price but yet the 5 period non wilder rsi is higher than that 10 day low.
and
can you help with a pcf that looks for a 10 day high in the price but yet the 5 period non wilder rsi is lower than that 10 day high.
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
Price and RSI are not plotted on the same scale so you can't really compare their values.
|
|
Registered User Joined: 9/11/2007 Posts: 28
|
ok, can you translate these into a pcf.
Positive RSI Divergence:
'# Period = userinput.integer = 50
If price.Close = price.MinClose(period) And price.Close < price.MinClose(period, period) * 1.01 AndAlso _
rsi.value = rsi.minlow(period) and rsi.value<30 and rsi.minlow(period) > rsi.MinLow(period, period) Then pass
Positive MACD Histogram Divergence:
'# Period = userinput.integer = 50
If price.Close = price.MinClose(period) And price.Close < price.MinClose(period, period) AndAlso _
mh.value = mh.minlow(period) And mh.minlow(period) > mh.MinLow(period, period) + .5 Then pass
Positive MACD Divergence:
'# Period = userinput.integer = 50
If price.Close = price.MinClose(period) And price.Close < price.MinClose(period, period) * 1.01 AndAlso _
macd.value = macd.minlow(period) and macd.minlow(period) > macd.MinLow(period, period) + .5 Then pass
Negative MACD Divergence:
'# Period = userinput.integer = 50
If price.Close = price.maxClose(period) And price.Close > price.maxClose(period, period) * .99 AndAlso _
macd.value = macd.maxhigh(period) And macd.maxhigh(period) < macd.maxhigh(period, period) Then pass
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
What period are you using on your RSI?
|
|
Registered User Joined: 9/11/2007 Posts: 28
|
5
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
Try this one and if it works for you for Positive RSI Divergence:
C = MinC50 and C < MInC50.50 * 1.01 and RSI5.1 = MIN(RSI5.1,50) and RSI5.1 < 30 and MIN(RSI5.1,50) > MIN(RSI5.1.50,50)
I don't find any stocks passing right now but I tested each Boolean independently and they returned the correct results.
What are the short and long period for the MACD indicator?
|
|
Registered User Joined: 9/11/2007 Posts: 28
|
12, 26, 9
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
Didn't notice you were using the MACD histogram before. The formula for a MACD histogram is
(XAVGC12 - XAVGC26) - (XAVG(XAVGC12,9) - XAVG(XAVGC26,9)
Unfortunately, you cannot group operators inside the MIN function.
MIN(RSI5.1,50) is valid.
MIN((XAVGC12 - XAVGC26) - (XAVG(XAVGC12,9) - XAVG(XAVGC26,9),50) is NOT valid.
|
|
Guest-1 |