StockFetcher Forums · Filter Exchange · Translating Relative Strength (against S&P 500 ETF) back into price indicator<< >>Post Follow-up
styliten
278 posts
msg #157765
Ignore styliten
modified
10/4/2021 10:38:00 AM

The following filter adds the price indicators on the main price plot showing what the prices would have been if the had performed on par with the S&P 500 ETF for the last 10[red band]/20[green band]/32[purple band] & 63[orange band] days. At some point stocks that have been performing poor for sometime relative to to the S&P 500 price levels would start the rebound process as if they are trying to make up for the losses/differences. The converse may also be true as people try to pocket the gains thereby dragging down the a stellar performer back to the S&P 500 average lines.

Feel free to modify if you prefer different # of days for gauging purposes.

Fetcher[dow 30

chart-time is 45 days

set{spy_10, close 10 days ago multiply by tsf(1 add to ind(SPY, ROC(10) divided by 100), 9)}
set{spy_20, close 20 days ago multiply by tsf(1 add to ind(SPY, ROC(20) divided by 100), 9)}
set{spy_32, close 32 days ago multiply by tsf(1 add to ind(SPY, ROC(32) divided by 100), 9)}
set{spy_63, close 63 days ago multiply by tsf(1 add to ind(SPY, ROC(63) divided by 100), 9)}

set{spy10000, spy_10 multiply by 1.0000}
set{spy10001, spy_10 multiply by 1.0005}
set{spy10002, spy_10 multiply by 0.9995}
set{spy10003, spy_10 multiply by 1.0010}
set{spy10004, spy_10 multiply by 0.9990}
set{spy10005, spy_10 multiply by 1.0015}
set{spy10006, spy_10 multiply by 0.9985}
set{spy10007, spy_10 multiply by 1.0020}
set{spy10008, spy_10 multiply by 0.9980}

and draw clri(spy10000, 10) on plot price
and draw clri(spy10001, 10) on plot price
and draw clri(spy10002, 10) on plot price
and draw clri(spy10003, 10) on plot price
and draw clri(spy10004, 10) on plot price
and draw clri(spy10005, 10) on plot price
and draw clri(spy10006, 10) on plot price
and draw clri(spy10007, 10) on plot price
and draw clri(spy10008, 10) on plot price

set{spy20000, spy_20 multiply by 1.0000}
set{spy20001, spy_20 multiply by 1.0005}
set{spy20002, spy_20 multiply by 0.9995}
set{spy20003, spy_20 multiply by 1.0010}
set{spy20004, spy_20 multiply by 0.9990}
set{spy20005, spy_20 multiply by 1.0015}
set{spy20006, spy_20 multiply by 0.9985}
set{spy20007, spy_20 multiply by 1.0020}
set{spy20008, spy_20 multiply by 0.9980}

and draw clri(spy20000, 11) on plot price
and draw clri(spy20001, 11) on plot price
and draw clri(spy20002, 11) on plot price
and draw clri(spy20003, 11) on plot price
and draw clri(spy20004, 11) on plot price
and draw clri(spy20005, 11) on plot price
and draw clri(spy20006, 11) on plot price
and draw clri(spy20007, 11) on plot price
and draw clri(spy20008, 11) on plot price

set{spy32000, spy_32 multiply by 1.0000}
set{spy32001, spy_32 multiply by 1.0005}
set{spy32002, spy_32 multiply by 0.9995}
set{spy32003, spy_32 multiply by 1.0010}
set{spy32004, spy_32 multiply by 0.9990}
set{spy32005, spy_32 multiply by 1.0015}
set{spy32006, spy_32 multiply by 0.9985}
set{spy32007, spy_32 multiply by 1.0020}
set{spy32008, spy_32 multiply by 0.9980}

and draw clri(spy32000, 12) on plot price
and draw clri(spy32001, 12) on plot price
and draw clri(spy32002, 12) on plot price
and draw clri(spy32003, 12) on plot price
and draw clri(spy32004, 12) on plot price
and draw clri(spy32005, 12) on plot price
and draw clri(spy32006, 12) on plot price
and draw clri(spy32007, 12) on plot price
and draw clri(spy32008, 12) on plot price

set{spy63000, spy_63 multiply by 1.0000}
set{spy63001, spy_63 multiply by 1.0005}
set{spy63002, spy_63 multiply by 0.9995}
set{spy63003, spy_63 multiply by 1.0010}
set{spy63004, spy_63 multiply by 0.9990}
set{spy63005, spy_63 multiply by 1.0015}
set{spy63006, spy_63 multiply by 0.9985}
set{spy63007, spy_63 multiply by 1.0020}
set{spy63008, spy_63 multiply by 0.9980}

and draw clri(spy63000, 13) on plot price
and draw clri(spy63001, 13) on plot price
and draw clri(spy63002, 13) on plot price
and draw clri(spy63003, 13) on plot price
and draw clri(spy63004, 13) on plot price
and draw clri(spy63005, 13) on plot price
and draw clri(spy63006, 13) on plot price
and draw clri(spy63007, 13) on plot price
and draw clri(spy63008, 13) on plot price
]



xarlor
562 posts
msg #157767
Ignore xarlor
10/4/2021 12:13:46 PM

That's pretty ingenious! Then again, most of your SF manipulations are. Thank you for this, very informative and a good way to glance at market health overall.

I had to add a legend since I kept forgetting which color corresponded with which days.

Fetcher[
dow 30

chart-time is 45 days

set{spy_10, close 10 days ago multiply by tsf(1 add to ind(SPY, ROC(10) divided by 100), 9)}
set{spy_20, close 20 days ago multiply by tsf(1 add to ind(SPY, ROC(20) divided by 100), 9)}
set{spy_32, close 32 days ago multiply by tsf(1 add to ind(SPY, ROC(32) divided by 100), 9)}
set{spy_63, close 63 days ago multiply by tsf(1 add to ind(SPY, ROC(63) divided by 100), 9)}

set{spy10000, spy_10 multiply by 1.0000}
set{spy10001, spy_10 multiply by 1.0005}
set{spy10002, spy_10 multiply by 0.9995}
set{spy10003, spy_10 multiply by 1.0010}
set{spy10004, spy_10 multiply by 0.9990}
set{spy10005, spy_10 multiply by 1.0015}
set{spy10006, spy_10 multiply by 0.9985}
set{spy10007, spy_10 multiply by 1.0020}
set{spy10008, spy_10 multiply by 0.9980}

and draw clri(spy10000, 10) on plot price
and draw clri(spy10001, 10) on plot price
and draw clri(spy10002, 10) on plot price
and draw clri(spy10003, 10) on plot price
and draw clri(spy10004, 10) on plot price
and draw clri(spy10005, 10) on plot price
and draw clri(spy10006, 10) on plot price
and draw clri(spy10007, 10) on plot price
and draw clri(spy10008, 10) on plot price

set{spy20000, spy_20 multiply by 1.0000}
set{spy20001, spy_20 multiply by 1.0005}
set{spy20002, spy_20 multiply by 0.9995}
set{spy20003, spy_20 multiply by 1.0010}
set{spy20004, spy_20 multiply by 0.9990}
set{spy20005, spy_20 multiply by 1.0015}
set{spy20006, spy_20 multiply by 0.9985}
set{spy20007, spy_20 multiply by 1.0020}
set{spy20008, spy_20 multiply by 0.9980}

and draw clri(spy20000, 11) on plot price
and draw clri(spy20001, 11) on plot price
and draw clri(spy20002, 11) on plot price
and draw clri(spy20003, 11) on plot price
and draw clri(spy20004, 11) on plot price
and draw clri(spy20005, 11) on plot price
and draw clri(spy20006, 11) on plot price
and draw clri(spy20007, 11) on plot price
and draw clri(spy20008, 11) on plot price

set{spy32000, spy_32 multiply by 1.0000}
set{spy32001, spy_32 multiply by 1.0005}
set{spy32002, spy_32 multiply by 0.9995}
set{spy32003, spy_32 multiply by 1.0010}
set{spy32004, spy_32 multiply by 0.9990}
set{spy32005, spy_32 multiply by 1.0015}
set{spy32006, spy_32 multiply by 0.9985}
set{spy32007, spy_32 multiply by 1.0020}
set{spy32008, spy_32 multiply by 0.9980}

and draw clri(spy32000, 12) on plot price
and draw clri(spy32001, 12) on plot price
and draw clri(spy32002, 12) on plot price
and draw clri(spy32003, 12) on plot price
and draw clri(spy32004, 12) on plot price
and draw clri(spy32005, 12) on plot price
and draw clri(spy32006, 12) on plot price
and draw clri(spy32007, 12) on plot price
and draw clri(spy32008, 12) on plot price

set{spy63000, spy_63 multiply by 1.0000}
set{spy63001, spy_63 multiply by 1.0005}
set{spy63002, spy_63 multiply by 0.9995}
set{spy63003, spy_63 multiply by 1.0010}
set{spy63004, spy_63 multiply by 0.9990}
set{spy63005, spy_63 multiply by 1.0015}
set{spy63006, spy_63 multiply by 0.9985}
set{spy63007, spy_63 multiply by 1.0020}
set{spy63008, spy_63 multiply by 0.9980}

and draw clri(spy63000, 13) on plot price
and draw clri(spy63001, 13) on plot price
and draw clri(spy63002, 13) on plot price
and draw clri(spy63003, 13) on plot price
and draw clri(spy63004, 13) on plot price
and draw clri(spy63005, 13) on plot price
and draw clri(spy63006, 13) on plot price
and draw clri(spy63007, 13) on plot price
and draw clri(spy63008, 13) on plot price

set{red,10}
set{green,20}
set{purple,32}
set{orange,63}
add column separator
add column red
add column green
add column purple
add column orange
]



styliten
278 posts
msg #157769
Ignore styliten
modified
10/4/2021 12:58:12 PM

@ xarlor

I realized the hard way that while subcharts are nice, they are also the biggest distractions! So incorporating anything meaningful into the main price plot (and get rid of ALL subcharts, if at all possible) is one and only ultimate goal! At the end of the day, people make buying and selling decisions on PRICES themselves, not on RSI, linear regression, or whatever.

Also, you can use this instead:

add column spy10000 {red_10}
add column spy20000 {green_20}
add column spy32000 {purple_32}
add column spy63000 {orange_63}

so it will show the calculated values for 10/20/32/63 periods.

glgene
613 posts
msg #157774
Ignore glgene
10/4/2021 9:22:49 PM

Styl — Your SF scripting is above my pay grade. I should go back to college!

Gene

Cheese
1,374 posts
msg #157775
Ignore Cheese
10/4/2021 11:13:51 PM

Thank you, sty.
Just a real simple case for me to learn.

Fetcher[

SYMLIST(SPY,SSO,SPXL)

chart-time is 5 months

set{spy_10, close 10 days ago multiply by tsf(1 add to ind(SPY, ROC(10) divided by 100), 9)}
set{spy_20, close 20 days ago multiply by tsf(1 add to ind(SPY, ROC(20) divided by 100), 9)}
set{spy_32, close 32 days ago multiply by tsf(1 add to ind(SPY, ROC(32) divided by 100), 9)}
set{spy_63, close 63 days ago multiply by tsf(1 add to ind(SPY, ROC(63) divided by 100), 9)}

set{spy10000, spy_10 multiply by 1.0000}
set{spy10001, spy_10 multiply by 1.0005}
set{spy10002, spy_10 multiply by 0.9995}
set{spy10003, spy_10 multiply by 1.0010}
set{spy10004, spy_10 multiply by 0.9990}
set{spy10005, spy_10 multiply by 1.0015}
set{spy10006, spy_10 multiply by 0.9985}
set{spy10007, spy_10 multiply by 1.0020}
set{spy10008, spy_10 multiply by 0.9980}

and draw clri(spy10000, 10) on plot price
and draw clri(spy10001, 10) on plot price
and draw clri(spy10002, 10) on plot price
and draw clri(spy10003, 10) on plot price
and draw clri(spy10004, 10) on plot price
and draw clri(spy10005, 10) on plot price
and draw clri(spy10006, 10) on plot price
and draw clri(spy10007, 10) on plot price
and draw clri(spy10008, 10) on plot price

set{spy20000, spy_20 multiply by 1.0000}
set{spy20001, spy_20 multiply by 1.0005}
set{spy20002, spy_20 multiply by 0.9995}
set{spy20003, spy_20 multiply by 1.0010}
set{spy20004, spy_20 multiply by 0.9990}
set{spy20005, spy_20 multiply by 1.0015}
set{spy20006, spy_20 multiply by 0.9985}
set{spy20007, spy_20 multiply by 1.0020}
set{spy20008, spy_20 multiply by 0.9980}

and draw clri(spy20000, 11) on plot price
and draw clri(spy20001, 11) on plot price
and draw clri(spy20002, 11) on plot price
and draw clri(spy20003, 11) on plot price
and draw clri(spy20004, 11) on plot price
and draw clri(spy20005, 11) on plot price
and draw clri(spy20006, 11) on plot price
and draw clri(spy20007, 11) on plot price
and draw clri(spy20008, 11) on plot price

set{spy32000, spy_32 multiply by 1.0000}
set{spy32001, spy_32 multiply by 1.0005}
set{spy32002, spy_32 multiply by 0.9995}
set{spy32003, spy_32 multiply by 1.0010}
set{spy32004, spy_32 multiply by 0.9990}
set{spy32005, spy_32 multiply by 1.0015}
set{spy32006, spy_32 multiply by 0.9985}
set{spy32007, spy_32 multiply by 1.0020}
set{spy32008, spy_32 multiply by 0.9980}

and draw clri(spy32000, 12) on plot price
and draw clri(spy32001, 12) on plot price
and draw clri(spy32002, 12) on plot price
and draw clri(spy32003, 12) on plot price
and draw clri(spy32004, 12) on plot price
and draw clri(spy32005, 12) on plot price
and draw clri(spy32006, 12) on plot price
and draw clri(spy32007, 12) on plot price
and draw clri(spy32008, 12) on plot price

set{spy63000, spy_63 multiply by 1.0000}
set{spy63001, spy_63 multiply by 1.0005}
set{spy63002, spy_63 multiply by 0.9995}
set{spy63003, spy_63 multiply by 1.0010}
set{spy63004, spy_63 multiply by 0.9990}
set{spy63005, spy_63 multiply by 1.0015}
set{spy63006, spy_63 multiply by 0.9985}
set{spy63007, spy_63 multiply by 1.0020}
set{spy63008, spy_63 multiply by 0.9980}

and draw clri(spy63000, 13) on plot price
and draw clri(spy63001, 13) on plot price
and draw clri(spy63002, 13) on plot price
and draw clri(spy63003, 13) on plot price
and draw clri(spy63004, 13) on plot price
and draw clri(spy63005, 13) on plot price
and draw clri(spy63006, 13) on plot price
and draw clri(spy63007, 13) on plot price
and draw clri(spy63008, 13) on plot price

add column spy10000 {red_10}
add column spy20000 {green_20}
add column spy32000 {purple_32}
add column spy63000 {orange_63}
]





StockFetcher Forums · Filter Exchange · Translating Relative Strength (against S&P 500 ETF) back into price indicator<< >>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.