2
$\begingroup$

I want to add some FinancialIndicator on InteractiveTradingChart when stock data is written in the form of list, {date, {o,h,l,c,v}}.

If I directly use a ticker symbol (for example, ^NKY), I can easily add FinancialIndicator:

InteractiveTradingChart[{"^NKY", {{2023, 3, 1}, {2023, 3,10}}}, {FinancialIndicator["ExponentialMovingAverage"]}]

This command gives a correct financial indicator (a moving average), this case is no problem: enter image description here

Let us now use a list form of stock data, instead of ticker symbol:

stockdata = {{{2023, 3, 1}, {27363.6, 27530.8, 27305.4, 27516.5, 0}}, {{2023, 3, 2}, {27564.8, 27617.8, 27408.5, 27498.9, 0}}, {{2023, 3,3}, {27683.3, 27961.2, 27655.3, 27927.5, 0}},{{2023, 3,6}, {28182.3, 28288.6, 28153.8, 28237.8, 0}}, {{2023, 3,7}, {28202.6, 28398.3, 28202.6, 28309.2, 0}}, {{2023, 3,8}, {28237.2, 28469.4, 28232.7, 28444.2, 0}}, {{2023, 3,9}, {28648.1, 28734.8, 28558.9, 28623.2, 0}}, {{2023, 3,10}, {28385.3, 28424.2, 28118.7, 28118.7, 0}}}

This stockdata has same dates and ohlcv shown in the first figure. Now, when I plot this data,

InteractiveTradingChart[stockdata, {FinancialIndicator["ExponentialMovingAverage"]}]

there is no financial indicator: enter image description here

I do not know how to fix the problem. I want to use stockdata form, not ticker symbol form.

My mathematica version is

$Version

13.2.1 for Mac OS X ARM (64-bit) (January 27, 2023)

Any comment is welcome, thank you.

$\endgroup$

1 Answer 1

3
+50
$\begingroup$

First, I can reproduce the issue with Mathematica 13.2.1 on Pop!_OS 22.04.

As I am a frequent user of the InteractiveTradingChart myself, I have reached out to the Wolfram Technical Support. They confirmed that it is indeed a bug.

As a temporary workaround, they have offered the following solution:

Dynamic[
  RawBoxes[
    Charting`iInteractiveTradingChart[
      InteractiveTradingChart,
      stockdata,
      List[
        FinancialIndicator["ExponentialMovingAverage", 10]
      ],
      Automatic
    ]
  ],
  Rule[
    SingleEvaluation,
    True
  ]
]
$\endgroup$
3
  • 3
    $\begingroup$ I also reported the issue to Wolfram Mathematica support against Mathematica 13.2.1, in this, on Windows 10 Pro 22H2 with current patches. I do note that using InteractiveTradingChart one can go the bottom of the chart select indicators > statistical > ExponentialMovingAverage and then it works. $\endgroup$
    – anon
    Mar 28, 2023 at 21:07
  • $\begingroup$ @Hans-Peter, Thank you very much for your comment. This tentative solution works fine. I expect Wolfram research team will fix the issue soon. $\endgroup$ Mar 29, 2023 at 0:26
  • $\begingroup$ @IAmANaïf Thank you also! $\endgroup$ Mar 29, 2023 at 0:27

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.