Thursday, March 30, 2023

Using the smfUpdateDownloadTable macro

---In smf_addin@yahoogroups.com, <rharmelink@...> wrote :

See also [Tip 2.1a] below from Randy.

This will give some visuals of creating a range to fill using the smfUpdateDownloadTable macro:

  1. The upper left hand corner cell of the table needs to have a range name of "Ticker" (see green-shaded cell on diagram). The text in the cell can be anything you want it to be.
  2. The cells below the "Ticker" cell should be filled in with Yahoo ticker symbols, one per cell (see yellow-shaded cells on diagram).
  3. The cells to the right of the "Ticker" cell should be filled with column titles (see orange-shaded cells on diagram. The text in these cells can be anything you want them to be.
  4. The cells above the column titles need to be filled in with SMF add-in formulas or element numbers (see blue-shaded cells on diagram). Use five tildas as a substitute for a ticker symbol. For example, any of the following text strings could be used to get "Market Capitalization" from Yahoo:

    941
    RCHGetElementNumber("~~~~~", 941)
    RCHGetTableCell("http://finance.yahoo.com/q/ks?s=~~~~~",1,">Market Cap")

    If you place an "X" in the cell of the element definition, it would tell the smfUpdateDownloadTable macro to skip it and leave that column alone. I do this when I want to create a column with my own formulas in, or to use as a divider column in the table.

The macro continues processing rows with ticker symbols (i.e. green-shaded cell) until it runs into an empty cell with no ticker symbol in it. It continues process across the row of element definitions (i.e. blue-shaded cells) until it runs into an empty cell with no element definition in it.

So, this is what it would look like after doing the four steps above:

 

After running the smfUpdateDownloadTable macro, it would look like this:

 

 If you use the Referback feature I found a couple of bugs:

1.  It will quit processing if it does a referback to a number that has been converted to display trillions as for example 1.35T

 The other is if the referback column contains N/A

 


Tip -- 2.1a - Using the smfUpdateDownloadTable macro

---In smf_addin@yahoogroups.com, <rharmelink@...> wrote :

I use the smfUpdateDownloadTable macro for such situations.  This would actually place values into the table, so no recalculation occurs.  When I want "fresh" values, I just rerun the macro.  Here is the documentation for the table setup from the macro's module:
  1. The upper left hand corner cell of the table needs to have a range name of "Ticker"
  2. The cells below the "Ticker" cell should be filled in with ticker symbols, one per cell
  3. The cells to the right of the "Ticker" cell should be filled with column titles
  4. The cells above the column titles need to be filled in with SMF add-in formulas or element numbers.  Use five tildas as a substitute for a ticker symbol.  For example, any of the following text strings could be used to get "Market Capitalization" from Yahoo:

    941
    RCHGetElementNumber("~~~~~", 941)
    RCHGetTableCell("http://finance.yahoo.com/q/ks?s=~~~~~",1,">Market Cap")
A recent addition to the process is that if the cell entry above a column title is an "x", that column is skipped from any update -- I use this for any calculation columns I want in the middle of my table.  In all of my workbooks, I assign the smfUpdateDownloadTable macro to a keyboard shortcut of Ctrl-Shift-J.

 

Tuesday, March 14, 2023

Python for SMF?

Could I utilize Python for SMF?

I have done some work with calling python modules from within Excel.  My issue has been that I have been unable to write to the currently open workbook.

For myself, I use python to get market data and data from IB (Interactive Brokers) and I write some of that data to Excel files.  It is quite easy to for python to read, create and modify data in Excel files.

There are add-ins to do this like PyXLL or XLWings, but they are somewhat commercial products.  I say somewhat since PyXLL has a 30 day demo and XLWings has an open source version that is free if somewhat feature limited.  In the spirit of Randy's SMF Add-In, I am working on a open source and free way of implementing python solutions for Stock Market Functions.

Some ideas that I am testing are creating some python utilities to do some of the work of the SMF Add-In that could work alongside of it.  Use it to get slow or hard to get data, write it to CSV or XLSX files that can be linked to a Stock Dashboard or other Workbook that can utilize that data.

Thursday, March 9, 2023

Website broken links #23

 The SMF group (https://groups.google.com/g/smf-addin) helped spot the numerous broken link and missing pages in the new site (https://climbermel.github.io/SMF_Add-in/).

I have fixed a lot of the broken links and I have created pages for the missing information in a number of areas.  There are still some pages that are more or less just placeholders as that was what was in the original site.  But these will at least now provide a page to show that instead of a 404 error for a missing page.

I'm still going through the code and would like to clean out the non usable code such as MSN, OX and Google where the data is no longer available.

So far I have made 155 updates to the code and web pages on GitHub (https://github.com/ClimberMel/SMF_Add-in).

Thanks to the members that have donated in various ways to help keep this add-in working.


Mel

Wednesday, March 1, 2023

Note on RCHGetYahooQuotes

Function  RCHGetYahooQuotes in module modGetYahooQuotes

This function is considered to be Obsolete 


Calling the function RCHGetYahooQuotes() in a spreadsheet will return no data

The function will return data if a full URL is provided and pItems are blank. 

Note that the function is being kept so that some calling modules such as RCHGetYahooHistory that do provide a URL in pTickers and pItems = "" will continue as they are.

The function could be used to test returning data based on a URL

For example:

=RCHGetYahooQuotes("https://query1.finance.yahoo.com/v7/finance/download/msft?period1=1262304000&period2=1735689600&interval=1d&events=history&includeAdjustedClose=true", "")



Saturday, February 25, 2023

New ZIP file -- Version 3.0.2023.02.24

 New release of SMF Add-In

The recent release is available on https://climbermel.github.io/SMF_Add-in/ 
I have changed the Home page a bit to modernize it somewhat.  I have also added two versions of the Add-In now.  This will be in case the newest one causes issues, it will be easier to get the last stable version in case you didn't save it.
 

 Modules updated:

Update smfGetYahooHistory.xlsx

    smfGetYahooHistory close / adjclose using wrong pItem codes #19

Update smfUtilities_.bas

    Duplicate Excel 2010 Function #18

Update modGetYahooHistory.bas

    Fix RCHGetYahooHistory function to match Item codes with smfGetYahooHistory see Issue #19

     RCHGetYahooHistory missing funtionality #13

Update smfGetYahooHistory.xlsx

    Added sample spreadsheet to Templates

Update modGetElementNumber.bas

    Update version

Other Issues fixed with new version 3.0.2023.02.24

    smfGetYahooPortfolioView possible incorrect data returned #9

 

Tuesday, February 21, 2023

New Release in Progress

 I have added these issues to the next release:

    - smfGetYahooPortfolioView possible incorrect data returned #9

    -  smfGetYahooHistory close / adjclose using wrong pItem codes #19

    -  Duplicate Excel 2010 Function #18

 

There was no issue with smfGetYahooPortfolioView.  The user was also calling smfGetYahooHistory and that is where they were getting unadjusted intead of adjusted close

Issue# 18 is some unused code in the add-in that matched an Excel internal function and will be deleted.  It may have been originally written before Excel added the IFERROR() function.

The following modules will be updated:

RCHGetYahooHistory() & smfGetYahooHistory to change the Items back to C for adjusted close and U for unadjusted close.  A will now be allowed as well, but simply be converted to use C for adjusted.

smfUtilities_ to remove function IfError().

modGetElementNumber to update version number


Monday, February 20, 2023

Duplicate Excel 2010 Function #18

 Issue submitted to GitHub by Joey

There is a routine in the smfUtilities_ module name IfError. There is a built-in Excel 2010 function with the same name.

There are no calls to it from any module. I am going to guess it was a formula that Randy used for something. He had a few routines that were for his testing and also for older versions of Excel. You can't call it in Excel 2010. I changed the name slightly so that I could call it and it returned 0 for a division be zero error but didn't display the error message.

I see no benefit to keeping unused code, so I will look at adding it to the next release as a deletion from smfUtilities_


SMF new Add-In version 3.0.2024.04.29

  This new release has fixes for: module smfGetOptionQuotes A member (Bruce) found the issue was with the crumb processing and provided cod...