Group Abstract Group Abstract

Message Boards Message Boards

0
|
142 Views
|
8 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Using a variable with CandlestickChart

Posted 10 days ago

So I am currently evaluating the desktop version of Wolfram for Desktop, and I am interesting in plotting financial data. I found the documentation here: https://reference.wolfram.com/language/ref/CandlestickChart.html

And while most of the examples don't work for me (because they assign the data to a variable "data", which is apparently illegal because the name "data" is more than one letter), this one worked:

CandlestickChart[{{{2025, 06, 16}, { 3412.49`, 3422.95`, 3374.33`, 3385.9`}},{{2025, 06, 17}, { 3386.0`, 3400.38`, 3366.38`, 3378.43`}},
{{2025, 06, 18}, { 3378.48`, 3397.11`, 3347.85`, 3370.52`}},
{{2025, 06, 19}, { 3370.53`, 3379.44`, 3340.58`, 3355.43`}},
{{2025, 06, 20}, { 3355.53`, 3390.0`, 3342.18`, 3366.8`}}}]

So that was nice, but I wanted to have the data in a dedicated variable, so that I could process it further. So I tried assigning it to a variable "C":

C = {{{2025, 06, 16}, { 3412.49`, 3422.95`, 3374.33`, 3385.9`}},{{2025, 06, 17}, { 3386.0`, 3400.38`, 3366.38`, 3378.43`}},{{2025, 06, 18}, { 3378.48`, 3397.11`, 3347.85`, 3370.52`}},{{2025, 06, 19}, { 3370.53`, 3379.44`, 3340.58`, 3355.43`}},{{2025, 06, 20}, { 3355.53`, 3390.0`, 3342.18`, 3366.8`}}}
CandlestickChart[C]

But for this I only get: CandlestickChart: C is not a valid dataset or list of datasets.

So I looked into converting my data into a dataset, but could not find any information (the generic term does not help).

It would be great if anyone could shed some light on this.

POSTED BY: Philipp Ludwig
8 Replies
Posted 9 days ago

...most of the examples don't work for me (because they assign the data to a variable "data", which is apparently illegal because the name "data" is more than one letter)...:

What are you talking about?

data is a perfectly valid symbol name.

POSTED BY: Eric Rimbey

It is not, and I found that other people faced this issue, to: https://community.wolfram.com/groups/-/m/t/3199730

Thank you @Mohammed for explaining the issue. I could not thank you earlier, because this forum lets me post only once per 24 hours (probably a limitation of free accounts).

POSTED BY: Philipp Ludwig
Posted 8 days ago

Well, if you want help, then provide more info about why you think you can't use data as a symbol name. Did you get an error message? Can you provide a sample notebook that demonstrates that it doesn't work? Are you sure you're using Mathematica, and not Wolfram|Alpha?

Maybe it has something to do with a trial version, but that seems like a stretch to me.

But whatever, I'm telling you, as someone who has used Mathematica for over 25 years, that you are absolutely not restricted to single character symbol names. Why would they put such examples in the documentation if you can't use them?

POSTED BY: Eric Rimbey

Thank you for your reply. As outlined in the discussion I linked, the error message is "No Wolfram Language translation found".

And I was under the impression that Mathematica is a part of Wolfram|Alpha (or vice versa).

POSTED BY: Philipp Ludwig
Posted 8 days ago

No, those are different products. If you're trying to use CandlestickChart then you should be using Mathematica. The product naming can be very confusing, and I think they are trying to finally unify products, so you might find it called Wolfram One, or some other variation. But if what you're using has "Alpha" attached to it at all, then that's a different product.

I'd suggest you contact Wolfram's customer support and make sure you're evaluating the product you really want to evaluate. Maybe you do want Alpha, but it sounds like you want Mathematica.

POSTED BY: Eric Rimbey

Thank you for the clarification. I looked into it and indeed I want Mathematica instead of Alpha Notebooks.

Luckily adding this as a trial option was incredibly easy, and I did not even had to re-install something.

Now the multi-letter identifiers work as expected.

POSTED BY: Philipp Ludwig
Posted 8 days ago

Yay! Now it all makes sense. I'm not very familiar with Wolfram|Alpha or Alpha Notebooks, so that's why I couldn't understand the problem before.

POSTED BY: Eric Rimbey

You cannot use upper case letter C and assign it a value, because it is a protected symbol: https://reference.wolfram.com/language/ref/C.html

Call your list for example lower case c and it will work.

POSTED BY: Mohammad Bahrami
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard