StockFetcher Forums · General Discussion · How to draw 2 RSI lines overlapping on same graph?<< 1 2 >>Post Follow-up
glgene
613 posts
msg #160077
Ignore glgene
2/6/2023 7:06:34 PM

[Fetcher
Symlist(spy,qqq,iwm,dia)
draw rsi(25)
draw rsi(100)
]
What additional 1 line of code do I need to add that would result in the 2 RSI lines overlapping each other on the same graph?

Gene in FL

xarlor
562 posts
msg #160078
Ignore xarlor
2/6/2023 8:31:00 PM

Fetcher[
Symlist(spy,qqq,iwm,dia)
draw rsi(25)
draw rsi(100) on plot rsi(25)
]



glgene
613 posts
msg #160079
Ignore glgene
2/6/2023 11:10:31 PM

Thank you, Xarlor. That’s just what I needed!

Gene in FL

Mactheriverrat
3,135 posts
msg #160080
Ignore Mactheriverrat
2/7/2023 11:14:11 AM

@Gene
What part of Florida are you from? I lived in South Florida for 30 years but moved away in 1989.

glgene
613 posts
msg #160081
Ignore glgene
2/7/2023 5:19:51 PM

Xarlor >> I took your script suggestion, implemented it, and added another feature: a Relative Moving Average (RMA) column and graph. That way, with a list of stocks, you can easily sort by the RSI 25/100 column ... and also see the % difference on the corresponding graph.

Look at EOD 2/7/2023. "CRM" is the RSI 25/100 leader at 1.26. That means "CRM" RSI 25 (at 1.26) is 26% above its RSI 100 (1.00 is the baseline x-crossover point). I also show 1-day ago and 5-day ago computations (so you can see if the scores are improving or declining -- on a Relative basis).

Whichever graph you view -- the crossover points are identical; that makes sense.

In the example below (EOD 2/7), I substituted the original 4-stock symlist with the "Dow 30" stocks, so you can scroll the list to examine for crossover points, such as "CAT" that went from its RMA score of 1.00 (1 day ago) to 0.99 today, 2/7 (that would be a crossover Sell); or "CSCO" that went from 0.99 (1 day ago) to 1.01 today, 2/7 (that would be a crossover Buy). View the "CAT" and "CSCO" graphs so you can view the crossover points.

Gene S.
(The Villages, FL)

Fetcher[
Dow 30
/*Symlist(spy,qqq,iwm,dia)*/

add column separator
add column roc(5){5-day_(gain or loss)_%}
add column separator
set{a, rsi(25)}
set{b, rsi(100)}
add column a{rsi_(25)}
add column b{rsi_(100)}
set{rsi.25.100, a/b}
add column separator
add column separator
add column separator
add column rsi.25.100{rsi_25/ rsi_100__ [x=1.00]}
add column rsi.25.100 1 day ago{1dgo}
add column rsi.25.100 5 days ago{5dgo}
add column separator
add column separator
add column separator
add column sector
add column industry
add column separator
draw rsi.25.100
draw rsi.25.100 line at 1.00
draw rsi(25)
draw rsi(100) on plot rsi(25)

sort on column 13 descending
]

glgene
613 posts
msg #160082
Ignore glgene
2/7/2023 5:39:18 PM

Xarlor >> My above script is not in blue and click-executable. I don’t know why. ??

Gene S.

xarlor
562 posts
msg #160083
Ignore xarlor
2/7/2023 6:22:51 PM

This line was breaking it. Don't use brackets [ ] within a filter:

add column rsi.25.100{rsi_25/ rsi_100__ [x=1.00]}

I changed the brackets to parentheses and it works.

Fetcher[
Dow 30
/*Symlist(spy,qqq,iwm,dia)*/

add column separator
add column roc(5){5-day_(gain or loss)_%}
add column separator
set{a, rsi(25)}
set{b, rsi(100)}
add column a{rsi_(25)}
add column b{rsi_(100)}
set{rsi.25.100, a/b}
add column separator
add column separator
add column separator
add column rsi.25.100{rsi_25/ rsi_100__ (x=1.00)}
add column rsi.25.100 1 day ago{1dgo}
add column rsi.25.100 5 days ago{5dgo}
add column separator
add column separator
add column separator
add column sector
add column industry
add column separator
draw rsi.25.100
draw rsi.25.100 line at 1.00
draw rsi(25)
draw rsi(100) on plot rsi(25)

sort on column 13 descending
]



glgene
613 posts
msg #160084
Ignore glgene
2/7/2023 6:49:24 PM

Xarlor >> Hmm. No [ ] in script, else the script won’t be click-executable in a message. Thank you!

Gene S. in FL

glgene
613 posts
msg #160085
Ignore glgene
2/8/2023 4:17:58 AM

OK -- Here are a few more additions to my RSI 25/100 script below. They have nothing to do with the RSI 25/100 calculations. They are simply columns that I use in some of my regular SF scripts:
1) P/E (price/earnings ... based on SF data sources)
2) Price/ 20-day MA (one of my favorite MA sorts; a RMA calculation. 100 = x-crossover)
3) 5-day Gain or Loss % (calculated as ROC(5)
4) Days Up (0-5) (Last 5 days indicating a Gain or Loss; it is a summation of the 1s from note #5)
5) D1 thru D5 (Last 5 days that indicate a gain or loss; 1=yes, 0=no)
Note 1: The Sort column for the script is RSI (25)/ RSI (100); it is framed in triple "add column separator" commands -- so you can quickly identify the Sort column when viewing the Table-output (I use this technique in several of my multi-column SF scripts).
Note 2: Why did I choose the RSI (25) and RSI (100) numbers? It was suggested at a recent seminar presentation I attended (vs. a typical Price MA). To my knowledge, it has not been backtested to examine the result metrics. Thus, RSI (25)/ RSI (100) is merely an experiment at this time.

I welcome constructive comments on this Script & output. Thank you.

-- Gene in FL

Fetcher[
/**** Script for RSI(25) / RSI(100). This is the sort column. ***/

Dow 30

/*SP500*/
/*Nasdaq 100*/
/*Russell 2000*/
/*Symlist(spy,qqq,iwm,dia)*/

add column separator
add column pe{p/e}
add column separator
set{rma20, price/ma(20)}
add column rma20 multiplied by 100{_price/_ma(20)_ ^x=100^}
add column rma20 1 day ago multiplied by 100{1dgo}
add column separator
add column roc(5){5-day_(gain or loss)_%}
add column separator
set{a, rsi(25)}
set{b, rsi(100)}
add column a{rsi_(25)}
add column b{rsi_(100)}
set{rsi.25.100, a/b}
add column separator
add column separator
add column separator
add column rsi.25.100{rsi_(25)/ rsi_(100)_ ^x=1.00^}
add column rsi.25.100 1 day ago{1dgo}
add column rsi.25.100 2 days ago{2dgo}
add column rsi.25.100 5 days ago{5dgo}
add column separator
add column separator
add column separator
add column sector
add column industry
add column separator
draw rsi.25.100
draw rsi.25.100 line at 1.00
draw rsi(25)
draw rsi(100) on plot rsi(25)

/*Up Days calculation below*/
set{p0, count(close > close 1 day ago,1)}
set{p1, count(close 1 day ago > close 2 days ago,1)}
set{p2, count(close 2 days ago > close 3 days ago,1)}
set{p3, count(close 3 days ago > close 4 days ago,1)}
set{p4, count(close 4 days ago > close 5 days ago,1)}

set{z, p0 + p1}
set{zz, z + p2}
set{zzz, zz + p3}
set{zzzz, zzz+ p4}

add column zzzz{days up 0_5}
add column separator
/*add column separator*/

/*set{sort,zzzz*1000}
set{sort1, sort+38b}
add column sort1{Sort1}
add column separator*/

add column p0{d1}
add column p1{d2}
add column p2{d3}
add column p3{d4}
add column p4{d5}
add column separator

sort on column 18 descending
chart-length is 2 months
]



nibor100
1,010 posts
msg #160086
Ignore nibor100
2/8/2023 10:38:57 AM

@glgene,

The reason you can't use [ and ] when trying to post a script is those are 2 of the key parameters of the
"Fetcher" statement as they bracket the script to be posted, having 2 extras messes up SF logic all to pieces.

Ed S.

StockFetcher Forums · General Discussion · How to draw 2 RSI lines overlapping on same graph?<< 1 2 >>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.