_SECTION_BEGIN("#-PredictCross");
// Probable MAcross bars
//p=20;
p=Param("fast",8,3,30,1);MAp=EMA(C,p);
//k=30;
k=Param("slow",13,3,30,1);MAk=EMA(C,k);
y=p*EMA(C,p)-(p-1)*Ref(EMA(C,p-1),-1);//Plot(y," ",colorPlum);
tClose=(p*(k-1)*MA(C,k-1)-k*(p-1)*MA(C,p-1))/(k-p);
DescCrossPrediction=Cross(tClose,C);
AscCrossPrediction=Cross(C,tClose);
ExpectMAcross=DescCrossPrediction OR AscCrossPrediction;
Confirmed=Cross(MAk,MAp) OR Cross(MAp,MAk);
UR=2*Highest(ROC(C,1));LR=2*Lowest(ROC(C,1));
Ucoeff=1+UR/100;Lcoeff=1+LR/100;
Filter = 1;//for the autoanalyser
//Filter=tClose<Lcoeff*C OR tClose>Ucoeff*C;//for the graph
AddColumn(MAp,"MAp");
AddColumn(MAk,"MAk");
AddColumn(Confirmed,"C-Cr");
AddColumn(ExpectMAcross,"Ex-Cr");
Plot(C,"",7*Filter+1,64);
Plot(MAp,"",4,1);Plot(MAk,"",5,1);
bars=BarsSince(Cross(MAp,MAk) OR Cross(MAk,MAp));
expect=NOT(Filter);
Title=Name()+" , "+
WriteIf(expect AND NOT(expectMAcross) AND NOT(Confirmed) AND bars>3 AND tClose<C,"EXPECT a bearish MAcross SOON","")+
WriteIf(expect AND NOT(expectMAcross) AND NOT(Confirmed) AND bars>3 AND tClose>C,"EXPECT a bullish MAcross SOON","")+
WriteIf(DescCrossPrediction,"EXPECT a bearish MAcross TOMORROW","")+
WriteIf(AscCrossPrediction,"EXPECT a bullish MAcross TOMORROW","")+
WriteIf(Confirmed,"--Confirmed_Cross","");
//In many cases Now, there is one "EXPECT SOON" AND one "EXPECT TOMORROW".
GraphXSpace=8;
_SECTION_END();
Eugene <eugenecpinto@xxxxxxxxxxx> wrote: