glgene 616 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 581 posts msg #160078 - Ignore xarlor |
2/6/2023 8:31:00 PM
|
glgene 616 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,153 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 616 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 616 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 581 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.
|
glgene 616 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 616 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
|
nibor100 1,031 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.
|