Watchlist column available for Relative Strength Scan


Category:
0
0

Hi Pete, I’ve been wanting to tinker with this one for awhile. Today I have successfully created scans that are synchronized with the studies on my charts. I am wondering if you have created watchlist columns along the way? It would be great to have a “rsi crossover” colored box and a “stronger than” colored box next to the symbols in my watchlist. Let me know please and if you have not created them but could build them for me that would be great! Doug
P.S. Just want you to know… I did attempt to massage the script for a column but honestly I’m pretty miserable at this thus reaching out to you.   https://www.hahn-tech.com/thinkorswim-scan-relative-strength/

Marked as spam
Posted by (Questions: 2, Answers: 3)
Asked on October 7, 2018 2:28 pm
334 views
0

Just a quick heads-up. I drew up the code for this but it does not work while equity markets are close. I will have to waiting until tomorrow morning and test it during market hours.

( at October 7, 2018 6:28 pm)
0
Private answer

Ok, when markets are open, this works. When markets are closed, it does not. You have been warned.

This is the code to show red or green background on the watchlist based on the relative strength of the ticker symbol in that row, as compared to the ticker symbol you select for “CorrelationWithSecurity”. The default value being “SPX”. Please note the user input “referenceDate” must be set to a day in which markets were open. The custom column must be set to daily. If you want details on the source of this code you will want to view the following video: https://www.hahn-tech.com/thinkorswim-scan-relative-strength/

input CorrelationWithSecurity = "SPX";
input referenceDate = 20171201;
def close2 = close(symbol = CorrelationWithSecurity);
def RS = if close2 == 0 then 0 else close / close2;
def startDate = DaysFromDate(referenceDate) == 0;
def sr = CompoundValue("historical data" = RS[0], "visible data" = if startDate <= 0 then sr[1] else RS[0]); def SRatio = sr; plot data = RS > SRatio;
AssignBackgroundColor(if data then Color.GREEN else Color.CURRENT);

Screenshot below shows the result.

I did not provide code for the “RSI Crossover” because that portion of the request lacked specific details. I suggest you post that as a new question and consider the following. How are the colors determined? RSI Crossing over what? Should the color change for only on the bar a crossover occurs or should the color remain the same color until the next opposite crossover?

Keep in mind that “RSI”… http://toslc.thinkorswim.com/center/reference/Tech-Indicators/studies-library/R-S/RSI.html

…is not the same as “Relative Strength” http://toslc.thinkorswim.com/center/reference/Tech-Indicators/studies-library/R-S/RelativeStrength.html

 

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4117)
Answered on October 8, 2018 8:06 am
0

Pete,

First I’d like to thank you for the forum and all you do to support technical traders.

With regard to the request for help with the column for “RSI” crossover…this was just a case of my using the wrong phrase. I was referring to the crossover created by your Relative Strength study.

I have observed that you support those that are attempting to learn and in this regard I continued to work on the Rel Strength Bullish Crossover installed as a column. It appears that I do not have it working…and no color of course as the efforts to adding color failed miserably.
Again, always appreciate your help for the individual trader.

( at October 8, 2018 9:04 am)
0

Yes, your observations are correct. I am very eager to teach whenever I get the chance. The best way for viewers to engage with that eagerness is to share their code, working or not. So go ahead and post a new question about how to do the RS crossover. Make sure to include as much detail as you can (when should the color change and what color and such). And if you want me to teach, be sure to include your code.

( at October 8, 2018 9:08 am)