Doug Hayman Posted May 6 Report Share Posted May 6 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. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted May 6 Report Share Posted May 6 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 1 Quote Link to comment Share on other sites More sharing options...
Doug Hayman Posted May 6 Author Report Share Posted May 6 Awesome, thanks so much Jerry! Quote Link to comment Share on other sites More sharing options...
Kasper Posted Saturday at 07:43 PM Report Share Posted Saturday at 07:43 PM Hello Jerry, Can you please send entire portfolio data in a WS API response? Alternatively, getPortSnapshot saves the CSV or JSON file on local disk and return file path/name in response. Thank you. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted Sunday at 09:56 PM Report Share Posted Sunday at 09:56 PM getPortSnapshot already returns the entire portfolio in a WS API response. Not sure what you are asking for there. As for saving to a file, you can right click on a portfolio, select SHARE and select the option to share to file Quote Link to comment Share on other sites More sharing options...
Kasper Posted Monday at 02:25 PM Report Share Posted Monday at 02:25 PM 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. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted Monday at 04:56 PM Report Share Posted Monday at 04:56 PM 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. Quote Link to comment Share on other sites More sharing options...
Kasper Posted yesterday at 12:11 AM Report Share Posted yesterday at 12:11 AM 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: Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted 21 hours ago Report Share Posted 21 hours ago That's awfully specific. You can just implement it all yourself by building a string with the key/value pairs, same as URL has key/value pares for parameters. Quote Link to comment Share on other sites More sharing options...
Kasper Posted 10 hours ago Report Share Posted 10 hours ago Sorry, I understand this idea looks tedious. I can build a string as you suggest, what MT command can I use to read it from my app? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.