+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    01-18-2010
    Location
    Nova Scotia, Canada
    MS-Off Ver
    Excel 2003
    Posts
    68

    Charting real-time DDE stock prices

    Hi all, I have a DDE spreadsheet that receives live stock prices coming into it. I can type a stock symbol (let's say MSFT) into cell A1 and the current stock price will automatically display in cell T1, and it will then update live in realtime... maybe once every 2 or 3 seconds or so.
    What I'd like to be able to do is to plot a chart of these live prices on MSFT coming into cell T1. I'm thinking however, that if I somehow write the value of T1 to some row each, say, 5 seconds, that pretty soon I'm going to have thousands and thousands of price quotes and it won't belong before I bog down my whole spreadsheet. Ideally (if possible), I'd like to only chart, say, the last few thousand price quotes and then every new price quote coming in would get tacked onto the end, while dropping off the oldest price quote from the beginning... so I'm never charting more than a few thousand price quotes at any one time.

    Has anybody ever wrestled with a problem like this?

    Thanks!
    Shawn

  2. #2
    Registered User
    Join Date
    01-18-2010
    Location
    Nova Scotia, Canada
    MS-Off Ver
    Excel 2003
    Posts
    68

    Re: Charting real-time DDE stock prices

    Any takers for this tricky one? Anybody? :-)

    Thanks
    Shawn

  3. #3
    Forum Moderator teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    2003 & 2010
    Posts
    10,042

    Re: Charting real-time DDE stock prices

    Conceptually speaking: You need a macro that will copy the current state of the cell and append it into the first empty cell of a given column.
    Then you need to define a dynamic range that always grabs the last x cells of the column. This dynamic range must then be defined for your data series.

    With the VBA to copy the data I can't help, unfortunately.

    The definition for the dynamic range can be something like

    =INDEX(Sheet1!$A:$A,COUNT(Sheet1!$A:$A)-500):INDEX(Sheet1!$A:$A,COUNT(Sheet1!$A:$A))

    This is for 500 data points.
    teylyn
    Microsoft MVP - Excel
    At Excelforum, you can say "Thank you!" by clicking the icon below the post.

    Avoid pie charts with more than two data points. Why? See here (pdf, 559 kb). The only acceptable pie chart is here.

  4. #4
    Registered User
    Join Date
    02-24-2010
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Charting real-time DDE stock prices

    Can you help me with that sheet, I am tring to have real time Exel sheet for my stocks but I couldn't do it
    I will be very please to you if you can help me with this matar

    thanks

    nsns

  5. #5
    Forum Moderator teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    2003 & 2010
    Posts
    10,042

    Re: Charting real-time DDE stock prices

    nsns,

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    teylyn
    Microsoft MVP - Excel
    At Excelforum, you can say "Thank you!" by clicking the icon below the post.

    Avoid pie charts with more than two data points. Why? See here (pdf, 559 kb). The only acceptable pie chart is here.

  6. #6
    Registered User
    Join Date
    01-18-2010
    Location
    Nova Scotia, Canada
    MS-Off Ver
    Excel 2003
    Posts
    68

    Re: Charting real-time DDE stock prices

    Thanks very much Teylyn, I'm going to fool around with this when I get time and I'll keep you posted!

    Cheers
    Shawn

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0