I have the following code:

Read all the DOW jones financial instruments

instruments = FinancialData["^DJI", "Members"]

Then I create a dynamic variable called ticker


ticker =.

And I create a popup menu with

{PopupMenu[Dynamic[ticker], instruments], Dynamic[ticker]}

So far it all works. I have my list of stock instruments in variable instruments and the popup menu comes up and when I pick a stock from it, the ticker (displayed to the right of the menu) updates to show the ticker I chose from the drop down list

My problem is that I would like to have a chart automatically updated once I pick a ticker. For now I have:

data = FinancialData[ticker, "OHLCV", {{2008, 7, 3}, {2008, 9, 30}}]

And I use


To display the chart

This works if I hit Shift enter on the last line. However, if I go to the popup menu and select a different stock (say INTC for Intel) the chart is not updated. I am new to Mathematica and I am sure that my problem is not understanding how Dynamic works.

What I don't understand

  • $\begingroup$ Indeed, welcome Henrick. You might have missed the question mark at the top right of your question entry box. This is a link that leads you to a short course in MarkDown, the layout system used here to prettify your text. $\endgroup$ Commented Feb 13, 2012 at 20:10
  • $\begingroup$ If you change your "data" definition to data = Dynamic[ FinancialData[ticker, "OHLCV", {{2008, 7, 3}, {2008, 9, 30}}]] then the data will update automatically. If you change the chart to InteractiveTradingChart[data[[1, All]]] then it will recognize the new data when that line is evaluated. However, I can't figure out how to make the chart update automatically. $\endgroup$
    – Tim Mayes
    Commented Feb 13, 2012 at 21:51

1 Answer 1


I believe the easiest way to accomplish this is with Manipulate.

   "OHLCV", {{2008, 7, 3}, {2008, 9, 30}}]], {ticker, instruments}]

enter image description here

  • 1
    $\begingroup$ I'm falling in love with Mathematica. Simple, effective. $\endgroup$
    – CHM
    Commented Feb 13, 2012 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.