StockFetcher Forums · General Discussion · Compare price to price of another stock, e.g. SPY<< >>Post Follow-up
perdi420
5 posts
msg #158909
Ignore perdi420
3/30/2022 6:01:45 PM

I would like to construct a rather simple indicator, but I am unable to find examples of how to do this.

Indicator = closing price of stock/closing price of SPY. How does one do this? For example, if stock price is 100 and SPY today is 400, the indicator should be 0.25.

I saw examples of "compare to SPY", but that not seem to do this. If I plot SPY itself for example, then this indicator should in theory be 1. But "Compare to" gives a curve, which is incorrect.

xarlor
587 posts
msg #158911
Ignore xarlor
3/31/2022 11:26:11 AM

Fetcher[
set{SPY_close,ind(SPY,close)}
set{my_indicator,close / SPY_close}

add column SPY_close
add column my_indicator
]



perdi420
5 posts
msg #158912
Ignore perdi420
4/1/2022 1:06:33 AM

Thank you. That is what I was looking for. Much appreciated.

StockFetcher Forums · General Discussion · Compare price to price of another stock, e.g. SPY<< >>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.