StockFetcher Forums · Filter Exchange · Filter code help - using RSI<< >>Post Follow-up
Kaylexa
11 posts
msg #99666
Ignore Kaylexa
3/15/2011 12:05:19 AM

Hello,

I've been trying to think of how to write some filter code to convey this thought:

Price is making a new 2-day low
RSI(5) is NOT making a new 2-day low

In other words, there is some short-term divergence between price and RSI(5).

Some other notes:

* I use daily charts, and I want to run this filter each day about an hour before the market close.

* For RSI(5), I don't just use the "close" to calculate my RSI reading. I use "(close + close + close + High + Low)/5"
This may or may not make any difference when drafting the StockFetcher code.

* Once I get some good working code, I also want to do the same thing for a new 3-day low, new 4-day low, and new 5-day low (not just a 2-day low).

* The main "guts" to this idea is the price and RSI(5) relationship. But a few other parameters I will also include in the filter are:

price is between 3 and 75
Average Volume(90) is above 100000
RSI(5) is between 0 and 50
price is above EMA(200)

Any help will be much appreciated. I love using StockFetcher and I enjoy trying to craft the right code. But I just can't get my mind to work for this one.

Thank you,

Kaylexa



Eman93
4,750 posts
msg #99670
Ignore Eman93
modified
3/15/2011 2:04:53 AM

This is an RSI divergence filter I wrote... Looking for a higher low on the rsi but price made a new 10 week low.

There is a thing called stock fetcher divergence... you can do search,

you need to use the set command to store the variable.

I look at the columns and if rsi today is greater than the 3 week low it could be more interesting.



low reached a new 10 week low

set{rslo, 0 + rsi(14) 10 week low}

set{rsla, 0 + rsi(14) 3 week low}

set{rstoday, 0 + rsi(14)}

set{rdlo, rslo / rsla}

set{rdlp, 1 - rdlo}

set{rmda, rslo - rstoday}

set{rmdb, rslo - rsla}

rdlo < 1

draw rsi(14) 10 week low

add column rstoday

add column rsla {3w low}

add column rslo {10W low}

add column rmdb
add column rdlp


Kaylexa
11 posts
msg #99688
Ignore Kaylexa
3/15/2011 4:37:45 PM

Eman93,

Thank you for your response. I'll look into your code. Right now I don't understand many of the terms in your code, but I'm sure I can pick it up. Again, thank you.

Hi All,

I thought it might be helpful to give you a few recent examples of a stock doing what I am looking for:

1. UNTD
On March 2, price closed at a new recent low of 5.86. On that day my RSI(5) closed at 5.96. A few days later, on March 7, price closed at a new low of 5.80. However, my RSI(5) closed higher at 16.95. I am looking for cases like this where price is making a new low (2-day, 3-day, 4-day, or 5-day lows) but my RSI(5) is not making a corresponding new low (it's making a higher low).

2. ACAT
On Feb 24, price closed at a new recent low of 12.72. On that day my RSI(5) closed at 11.06. A few days later, on March 1, price closed at a new low of 12.40. However, my RSI(5) closed at 19.14. Another good case of what I am looking to find each day using StockFetcher.

3. CMN
This is an example from the short side. On March 9, price closed at a new recent high of 25.73. On that day my RSI(5) closed at 92.97. A few days later, on March 14, price closed at a new high of 26.03. However, my RSI(5) closed lower at 84.28. I went short here.

It's just a simple RSI divergence play. But for some reason I can't seem to create some proper filter code. I've been creating other codes for months. But this one has me a bit stumped.

Thanks in advance,

Kaylexa



Eman93
4,750 posts
msg #99692
Ignore Eman93
3/15/2011 7:39:19 PM

low reached a new 10 week low .... first I am looking for a stock that made a new 10 week low

set{rslo, 0 + rsi(14) 10 week low} storing the value of the 10 week low of the RSI it may or may not be the same day

set{rsla, 0 + rsi(14) 3 week low} storing the value of the 3 week low of the RSI

set{rstoday, 0 + rsi(14)} storing the value of the RSI today

set{rdlo, rslo / rsla} dividing the RSI 10 week low by the 3 week low... we want the 3 week low to be a bigger number than the 10 week low { ex 10/30} so skip down you want the rdlo to be less than 1 for the divergence to be true... price is making a new low but RSI is higher than the last swing low... you need to eyeball the good setups

set{rdlp, 1 - rdlo}

set{rmda, rslo - rstoday}

set{rmdb, rslo - rsla}

rdlo < 1

draw rsi(14) 10 week low

add column rstoday

add column rsla {3w low}

add column rslo {10W low}

add column rmdb
add column rdlp

StockFetcher Forums · Filter Exchange · Filter code help - using RSI<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.