Message Boards Message Boards


Overlay on TradingChart[ ]

Posted 2 months ago
3 Replies
2 Total Likes

I am trying to overlay a line plot on a TradingChart. I have tried a number of things but can't achieve what I want. What I have done is better explained in the attached notebook. Thanks

3 Replies

I will reply to my own question. As I was looking at some other posts regarding overlaying graphics I saw the Prolog option and tried the following which worked (see attached notebook).

I still don't understand why just changing Epilog to Prolog made it work. With Epilog I could not see my line segments. With Prolog the line segments appeared.

Posted 2 months ago

TradingChart is a composite of two Graphics. Looks like Epilog is added to the second one (volume chart) and Prolog is added to the first one.

scaledPath = MapAt[2*10^5 # &, currentPath, {All, 2}];
TradingChart[data[[1 ;; 32]],
 Epilog -> {Thickness[0.0075], Black, Line[scaledPath], PointSize[Medium], Red, Point[scaledPath]},
 Prolog -> {Thickness[0.0075], Black, Line[currentPath], PointSize[Medium], Red, Point[currentPath]}]

enter image description here

Hello Rohit,

Now, that would make sense. I hadn't thought of that.

Thanks Henrick

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract