EPS Surprise (Working)
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © jerrylui

//@version=5
indicator("EPS Surprise")

earning = request.earnings(syminfo.tickerid, earnings.actual)
estimate = request.earnings(syminfo.tickerid, earnings.estimate)

p1 = plot(earning, "Actual", color=color.white, linewidth=1)
p2 = plot(estimate, "Estimate", color=color.gray, linewidth=1)
fill(p1, p2, color=(earning>=estimate)?color.green:color.red, title="Fill Color")