On Earnings by Jesse on Mr Script show
Code:
#The move after earnings
declare lower;
plot EstEarning = getEstimatedEarnings();
EstEarning.SetPaintingStrategy(PaintingStrategy.POINTS);
plot actual_earnings= getactualearnings();
actual_earnings.setpaintingstrategy(paintingstrategy.points);
def c = if actual_earnings then getyyyymmdd() else double.nan;
def d = c + 1;
def e = if c then close(period = aggregationperiod.day) else double.nan;
def f = if d then open(period = aggregationperiod.day)[-1] else double.nan;
plot "Move after earnings" = f - e;
"Move after earnings".setpaintingstrategy(paintingstrategy.points);
###########################
#The below is how to scan for earnings
Input length = 10;#hint length: The days to scan for
def a = hasearnings();
def b = getday();
def c = if a then b else 0;
def d = average(c, length);
def e = d[-length];
plot f = e > 0;