Message Boards Message Boards

Why different results from TradingChart?

GROUPS:

I am using Mathematica 11.0.1 (Enterprise license) on a Mac OS X 10.12.5.

Part of a larger project is not working. I have isolated the problem. Here is a simplified version of the problem:

CloudDeploy[
    Delayed[
        APIFunction[{},
            chart = TradingChart[ "SP500", {"Volume", "SimpleMovingAverage", "BollingerBands"}];
            InputForm[{chart}] &]],
    "CS_pack_Grap3", Permissions -> "Public"]

The above code produces a cloud object that when run displays this as output:

InputForm[{TradingChart["SP500", {"Volume", "SimpleMovingAverage", "BollingerBands"}]}] 

Instead, I expect it to output the functions that assemble the actual graph, something like:

Graphics[DynamicModule[{
    System`TradingChartDump`$timestampdepth = "Full",
     System`TradingChartDump`$highlightposition = Automatic,
     System`TradingChartDump`$maxohlc = 2463.54`6., 
   System`TradingChartDump`$timestampstyle = Directive[GrayLevel[0.75], Opacity[0.25]],
     System`TradingChartDump`$dates = {3701376000...        **(many lines of code omitted)**

The larger project uses this same technique on many different data visualization functions, and the cloud object always outputs the details of the graph, not the original function that created the graph. For instance, if I run the following...

CloudDeploy[
 Delayed[
  APIFunction[{},
   chart = ListLinePlot[Prime[Range[25]], Filling -> Axis];
   InputForm[{chart}] &]],
 "CS_pack_Grap3", Permissions -> "Public"]

...the cloud object outputs the chart's details as expected:

InputForm[{Graphics[{{}, GraphicsComplex[{{1., 2.}, {2., 3.}, {3., 5.}, {4., 7.}, {5., 11.}, {6., 13.}, {7., 17.}, 
    {8., 19.}, {9., 23.}, {10., 29.}, {11., 31.}, {12., 37.}, {13., 41.}, {14., 43.}, {15., 47.}, {16., 53.}, {17., 59.}, 
    {18., 61.}, {19., 67.}, {20., 71.}, {21., 73.}, {22., 79.}, {23., 83.}, {24., 89.}, {25., 97.}, {1., 0.}, {25., 0.}},
     {{{}, {EdgeForm[], Directive[RGBColor[...                **(many lines of output omitted)**

That is the problem as simply as I can state it to the best of my understanding. Why I would want the detailed instructions for the TradingChart and why it has to go through a cloud object are more involved and I hope not necessary to this question.

My question is why is the TradingChart[] producing a different kind of output and how can I get it to produce the output I expect?

Thank you in advance,

Mark Greenberg

POSTED BY: Mark Greenberg
Answer
2 months ago

Group Abstract Group Abstract