One aspect I really appreciate of charting apps that offer custom coding capabilities is that you can present information visually that typically is not shown in that manner. For example with a few lines of thinkscript code you can plot a line graph of quarterly EPS in thinkorswim.
What follows is a screenshot of the line graph I wrote in less than 30 lines of code. The red and green dots represent the quarterly earnings, indicating if the current results were up/down from the previous report. I also appended at the bottom of the image the optional EPS bubble.
Installing the EPS Line Graph
You can also copy/paste the link into thinkorswim’s Open Shared Item feature, the link is: https://tos.mx/gzJMkvw.
EPS Line Graph thinkscript Code
Here’s the code to create the line graph as well as show the optional chart bubble.
# EPS line graph # # Written by: @JohnMuchow http://twitter.com/JohnMuchow # Website: PlayTheTrade.com # # v1.0 declare lower; input showEPSBubble = yes; def e = GetActualEarnings(); def earnings = CompoundValue(1, if IsNaN(e) then earnings else e, e); # Plot the earnings as a line plot earningsLine = e; earningsLine.SetPaintingStrategy(PaintingStrategy.POINTS); earningsLine.SetDefaultColor(CreateColor(90, 122, 176)); earningsLine.hideTitle(); # Given earnings are not relevant for each bar, approximate line from bar to bar earningsLine.EnableApproximation(); # Plot green/red dot indicating earnings up/down plot earningsUpDownIndicator = GetActualEarnings(); earningsUpDownIndicator.SetPaintingStrategy(PaintingStrategy.SQUARES); earningsUpDownIndicator.AssignValueColor(if earnings > earnings then (CreateColor(120, 184, 86)) else CreateColor(164, 36, 22)); earningsUpDownIndicator.SetLineWeight(4); earningsUpDownIndicator.hideTitle(); # Optional EPS bubble AddChartBubble(showEPSBubble, earningsUpDownIndicator, earnings, Color.GRAY);