Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

What I would like to do is generate a chart similar to the TradingChart but to have two lines on it instead of the candlestick.

The lines I want to plot will look something like this;

enter image description here

And what I want to do is replace the top plot on this chart;

enter image description here

The idea is to have the two lines on the DateListPlot with the trading volume bar chart below.

By question is am I better off setting up a GraphicsColumn with a DateListPlot and a BarChart or can I modify the TradingChart to get it to do what I want? I'd prefer to modify the TradignChart because it's got some nice interactive content which I don't know how to do myself.

share|improve this question
    
Where are those 2 lines? - are they some sort of indicators, like Bollinger bands or Moving average envelopes? Also could you please give your code. –  Vitaliy Kaurov Feb 13 '13 at 5:13

1 Answer 1

up vote 5 down vote accepted

Appearance->"Line" option setting gives line graphs:

 TradingChart[{"GOOG", {{2010, 1, 1}, {2010, 6, 1}}}, {"Open", "Low", 
  "High", "Volume"}, Appearance -> "Line"]

enter image description here

You can also use ChartElementFunction->"Line":

 TradingChart[{"GOOG", {{2010, 1, 1}, {2010, 6, 1}}}, {"Open", "Low", "High"},
 ChartElementFunction -> "Line"]

enter image description here

By the way, this setting does not appear in the list of functions in ChartElementData["TradingChart"]:

 ChartElementData["TradingChart"]
 (* {"ArrowCandlestick", "Candlestick", "FadingCandlestick",  "FadingOHLC", 
   "GlassCandlestick", "HLC", "OHLC"}*)

With InteractiveTradingChart, selecting the option None or the option Line for ChartType produces line graphs of selected indicators:

 InteractiveTradingChart[{"GOOG", {{2009, 6, 1}, {2010, 6, 1}}}]

enter image description here

share|improve this answer
    
Thanks for that, the Appearance->"Line" option looks like what I want. One small point is that I'd like to replace the Open/Low/High tags with something like Close/Model_1/Model_2. It seems you can do something like this with the InteractiveTradingChart but you can only select from their list of indicators. –  Cam Feb 13 '13 at 6:26
    
Cam, as far as i can tell it is impossible to make such tweaks in the InteractiveTradingChart by playing with the documented options. BTW, that would make a really good new question. Perhaps some spelunking to identify what to Replace/ReplaceAll and by post-processing to make the appropriate replacement might work. Better yet, someone from Wolfram may suggest methods/tricks to do this kind of customization. –  kguler Feb 13 '13 at 7:12
    
Thanks kguler, I think you've answered this question. I'll email Wolfram and see if I get anything. What I want to be able to do is compare different option pricing models to the closing spot price for the options itself. It may be something Wolfram would be interested in. –  Cam Feb 13 '13 at 22:06
    
@Cam, Thank you for the accept. Actually, you have two great questions: (1) how to change the legends displayed on mouseover, ie, replace "O:","H:" ... by "mylabel1",..., and (2) how to use your custom-built finanical indicator function in TradingChart. For both, it would be great if you can post the question and the response from Wolfram. –  kguler Feb 13 '13 at 22:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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