Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Scripts return historical stock prices adjusted for splits

It seems that for at least the Yahoo and AlphaVantage scripts the stock prices that are returned are adjusted for stock splits. That creates an issue when it is necessary to "re-build" the quotes file as the re-built files end up containing the split adjusted quotes - while the srcTrans data in Portfolio Slicer has the original "unsplit" buy/sell transactions. Should the scripts not return the unadjusted stock prices?

Comments

  • If you requested quotes for the website, for example Yahoo, and they are already adjusted for splits, your options are:
    1. Try requesting quotes from different source and see if they are not adjusted there. If that does not work, then you should do option 2.
    2. Load adjusted quotes into Excel, then fix price - like applying "unadjustment" and save quotes in the same format as all quotes are saved.
  • Could you explain option 2 a little more please? What do you mean by "Load adjusted quotes into Excel, then fix price..."

    I have the problem with AAPL. It split in 2014 7:1 but my data goes back to 2010. So all my holdings values before 2014 are too low by a factor of 7.
    I edited the Quotes.txt and Quotes.csv manually and changed price to the unadjusted value but see no change in my Holdings worksheet. It still shows the split adjusted price.

    I am also confused about the Quotes.txt vs the Quotes.csv files.
    Is the Quotes.csv file generated by the Quotes.txt file when I run Refresh All? Which of the two files is used in the Pivot tables?

    Assuming that manually editing the prices work, the values will again change back to the adjusted prices every time I rebuild the quotes files running the script. So I end up with the same wrong results.
    Hope you can clarify this issues. Thanks.
  • edited May 2020
    Hi,

    When you run scripts, data is downloaded from Yahoo website and stored on your PC in \Quotes\__.txt file. Before every extract script first checks what is the latest quote date in that file and then request just quotes ONE DAY AFTER LATEST DATE IN THAT FILE. So you can change quotes in that file after extract and they will not be overritten after you run extract scripts again. Here is explanation on how quote are stores localy: http://www.portfolioslicer.com/scripts/quotes-data.html
    File PSDATA\Quotes.csv is recreated every time you run script, but it uses files from Quotes\*.txt subfolder!
  • That is good to know. I finally got it to work. I have been using Portfolio Slicer now for about 2 weeks. I love the program and it provides good analysis. The two issues I see are the complexity of external data import, dividends, etc. and speed. I run Excel 2016 and it is very slow to refresh. Granted I have a lot of data - 10 years of history and over 50 securities. But any speed improvement would be much appreciated.
  • I assume that old, manually edited, dividends in the \Dividends\_.txt file will also NOT be overwritten when running the script. Is that correct?
  • Yes, when you update data in DIvidends\_.txt files, that data is never replaced, just new records are added.
Sign In or Register to comment.