HOW About 2 for 2? I think many will find this contribution useful.
This is a Quarterly Earnings Indicator. It tells you dynamically (warns you using colors on a chart) based on past earnings release dates automatically when the next Quarterly Earnings release date is. If you think it is neat or have found other uses for it, let me know.
And, if anyone could give me assistance in turning into a viable Radarscreen Inidcator for TS, I would appreciate it. It's a little perplexing, but put it on a chart and see how useful it is, as it shows the interplay of earnings releases and stock movements. It works ok I guess (not 100% precise) after months of testing, but would work better as an RS indicator.
Despite, RS's static limitations, the way this is written is applicable for RS with green for earnings "Just released", yellow for "earnings date imminent", pink for earnings "recently released" and red for "not due for a while." That's one way to interpret it, but feel free to interpret whatever way you want.
HERE IS THE CHART CODE:
inputs:
AvgLength( 14 ),
ValueToPlotOnError( 0 ) ; { ValueToPlotOnError is the value that will be plotted
if an error occurs retrieving the EPS value. }
variables:
oSBBFErr0( 0 ),
oSBBFErr1( 0 ),
oSBBFErr2( 0 ),
oSBBFErr3( 0 ),
SBBF0( 0 ),
SBBF1( 0 ),
SBBF2( 0 ),
SBBF3( 0 ),
EarningsTTM( 0 ),
PEBasic( 0 ),
AvgPEBasic( 0 ) ;
oSBBFErr0 = 0 ;
oSBBFErr1 = 0 ;
oSBBFErr2 = 0 ;
oSBBFErr3 = 0 ;
SBBF0 = FundValue( "SBBF", 0, oSBBFErr0 ) ;
SBBF1 = FundValue( "SBBF", 1, oSBBFErr1 ) ;
SBBF2 = FundValue( "SBBF", 2, oSBBFErr2 ) ;
SBBF3 = FundValue( "SBBF", 3, oSBBFErr3 ) ;
if oSBBFErr0 = fdrOk
and oSBBFErr1 = fdrOk
and oSBBFErr2 = fdrOk
and oSBBFErr3 = fdrOk
then
begin
EarningsTTM = SumList( SBBF0, SBBF1, SBBF2, SBBF3 ) ;
if EarningsTTM <> 0 then
PEBasic = Close / EarningsTTM ;
AvgPEBasic = Average( PEBasic, AvgLength ) ;
Plot1( EarningsTTM, "EarningsTTM" ) ;
// Plot1( PEBasic, "PEBasic" ) ;
if CurrentBar > AvgLength then
// Plot2( AvgPEBasic, "AvgPEBasic" ) ;
// Plot2(0);
value1=0; //dummy code
end
else
begin
Plot1( ValueToPlotOnError, "EarningsTTM" ) ;
// Plot2( ValueToPlotOnError ) ;
end ;
//Plot3( 0, "Zero Line" ) ;
// The part above can be found @
https://www.tradestation.com/Discussion ... xactMatch=
/////////////////////////////////////////////////////////////////////////////////////////
// This is the part to estimate the Earning Release Date
Var: BarChange(0), BarDelta(0), PrevBarChange(0), MinBarDelta(0), SumBarDeltas(0), CountBarDeltas(0), AvgBarDelta(0);
var: BarsToChangeMin(0), BarsToChangeAvg(0);
If Barnumber=1 Then MinBarDelta = 999999999999;
if EarningsTTM <> EarningsTTM[1] Then Begin
PrevBarChange=BarChange;
BarChange=BarNumber;
BarDelta = BarChange - PrevBarChange ;
If BarDelta > 50 Then Begin
SumBarDeltas = SumBarDeltas + BarDelta ;
CountBarDeltas = CountBarDeltas + 1 ;
AvgBarDelta = SumBarDeltas / CountBarDeltas ;
If BarDelta < MinBarDelta Then MinBarDelta = BarDelta ;
Print(BarDelta," " , MinBarDelta," " , AvgBarDelta);
End;
End ;
Inputs: DaysAfter(10),
BarsPriorMinDate(9),
BarsPriorAvgDate(4);
if EarningsTTM <> EarningsTTM[DaysAfter] Then SetPlotColor(1,Magenta);
BarsToChangeMin = BarChange + MinBarDelta - BarNumber ;
BarsToChangeAvg = BarChange + AvgBarDelta - BarNumber ;
If BarsToChangeMin < BarsPriorMinDate Then Begin
SetPlotColor(1, Yellow);
SetPlotWidth(1, 4) ;
end;
If BarsToChangeAvg < BarsPriorAvgDate Then Begin
SetPlotColor(1, Green);
SetPlotWidth(1, 5);
End;