Manipulate InteractiveTradingChart or lazy Manipulate

3

Back in 2012, it seems that something like Manipulate[InteractiveTradingChart[ticker], {ticker, {"AMZN", "GOOGL"}}] worked fine. Mathematica 12.2 however is not able to handle this anymore and seems to get stuck in some kind of initialization loop.

It would be great if this functionality could be restored by Wolfram. In the meantime, I am curious whether there exists a workaround.

Is it for example possible to instruct Manipulate to trigger computation only when a parameter value changes and avoid precomputing results, i.e., is there a way to make Manipulate "lazy"?

Math Gaudium

Posted 2021-01-03T23:30:49.640

Reputation: 55

For the last question, look at TrackedSymbols.

– MarcoB – 2021-01-03T23:42:25.787

Thank you for the hint but could you be more explicit on how this could solve the problem with InteractiveTradingChart? For example, Manipulate[InteractiveTradingChart[ticker], {ticker, {"AMZN", "GOOGL"}}, {u, {1, 2}}, TrackedSymbols :> {u}] does not work, i.e., clicking on values for u does not result in a working plot. – Math Gaudium – 2021-01-03T23:56:17.170

It look like s the approach using Manipulate is broken in V12, but I have found that TabView works well. See my answer. – m_goldberg – 2021-01-04T01:27:16.790

Answers

4

This seems to work:

Module[{amzn, googl},
  amzn = InteractiveTradingChart[{"AMZN", {{2009, 1, 1}, {2009, 12, 31}}}];
  googl = InteractiveTradingChart[{"GOOGL", {{2009, 1, 1}, {2009, 12, 31}}}];
  TabView[{"AMZN" -> amzn, "GOOGL" -> googl}]]

tab_a

tab_g

m_goldberg

Posted 2021-01-03T23:30:49.640

Reputation: 104 223

Great, thank you. – Math Gaudium – 2021-01-04T01:28:53.363

By the way, replacing TabView by MenuView works as well. – Math Gaudium – 2021-01-04T02:08:23.937

@MathGaudium. Indeed. – m_goldberg – 2021-01-04T11:54:35.563