Jump to content
Medved Trader Forums

CSV Export of Portfolio


Doug Hayman

Recommended Posts

Does MT support a CSV export of data from a portfolio by any chance (maybe through old API)?   I want to create a simple portfolio list of Ticker and Yield% for a # of stocks and mutual funds.  In other words, I want to obtain current Yield%, not a history of Yield%'s; one record per ticker.

The "free" Yahoo Finance only permits a standard set of columns for their Export, even though I can create a portfolio view for that.

I'm trying to avoid having to do a screen scrape for the Yahoo View.

Thanks in advance.

Link to comment
Share on other sites

you can right click on the portfolio and select SHARE.  on the popup that comes up, select to Save File (left side) and then

Share as "Text"
Text Range "All"
Delimiters "Comma"

and of course specify the file and location

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

The getPortSnapshot returns a fixed set of data points, I believe similar to getSymbolSnapshot. I'm looking for all columns selected in a portfolio, or user specified set of columns, for all symbols in a portfolio.

Yes, manual saving of the file is possible but my use case has series of options portfolios with different funneling scans. The automation of command and data in a WS API response will very helpful.

Link to comment
Share on other sites

the selection of columns in the portfolio window in UI has no bearing on the API response.  For UI specific columns, would have to use the SHARE option.  As far as automating it, that would be a bit trickier. may be able to use our PASTE API in conjunction with the WS API enumWindows command (not documented, sorry). Basically get enumWindows, find the portfolio you want in the result and note the handle, use some automation to then send a clipboard PASTE command to the window using the handle with JSON command to share. 

If that is something that you can do, we can add the share command to the PASTE API in case it is not already there. 

Link to comment
Share on other sites

I have used enumWindows for other tasks. With this task, I have used the share shortcut key and it saves the file but then I have to do some manual work of working with files.

I used the Intervar commands but it requires one API call per data point per symbol. This gets the data but there's some latency and high number of API calls for each portfolio.

Instead of Paste API command for share, can you make another Get/Set Intervar command that supports dictionary? I could use something like this:

image.png.ebdb06b7813ea4467b0998d21c50d79f.png

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...