PureBytes Links
Trading Reference Links
|
We may calculate the next bar Close necessary for a MA(C,p) to
cross another MA(C,k).
I will overcome this procedure and I will try just to predict
if a cross will occur tomorrow.
For your AA window explore for the n=1 last quotations
with
// Prediction for a cross of two moving averages
<FONT
size=2>p=20;MAp=MA(C,p);Plot(MAp,"",1,8);k=30;MAk=MA(C,k);Plot(MAk,"",2,8);y=p*MA(C,p)-(p-1)*Ref(MA(C,p-1),-1);//Plot(Ref(C,0),"",7,8);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);ConfirmedDesc=Cross(MAk,MAp);ConfirmedAsc=Cross(MAp,MAk);Title=Name()+WriteIf(ConfirmedDesc,",
Confirmed descending MAcross","")+WriteIf(DescCrossPrediction,", A
descending MAcross will occur tomorrow","")+WriteIf(ConfirmedAsc,",
Confirmed ascending MAcross","")+WriteIf(AscCrossPrediction,", An ascending
MAcross will occur
tomorrow","");Filter=1;AddColumn(Cum(DescCrossPrediction),"Predicted
DescCrosses",1.0);AddColumn(Cum(ConfirmedDesc),"Confirmed
DescCrosses",1.0);AddColumn(100*Cum(DescCrossPrediction)/Cum(ConfirmedDesc),"Desc
%");AddColumn(Cum(AscCrossPrediction),"Predicted
AscCrosses",1.0);AddColumn(Cum(ConfirmedAsc),"Confirmed
AscCrosses",1.0);AddColumn(100*Cum(AscCrossPrediction)/Cum(ConfirmedAsc),"Asc
%",1.0);
to see the commulative predicted/actual cross
relation.
Replace the Filter=1; line with the
Filter=<FONT
color=#000000 face="Times New Roman">AscCrossPrediction OR
DescCrossPrediction;
<FONT color=#000000
face="Times New Roman">to see the predictions for tomorrow, or with the
<FONT color=#000000
face="Times New Roman">Filter=<FONT color=#ffffe0
face=Verdana><FONT color=#000000 face="Times New Roman"
size=2>Ref(AscCrossPrediction OR DescCrossPrediction,-1);<FONT
size=2>
to see the confirmed
crosses
The commulative view for my favorites selection is in the
attached gif.
A detailed analysis will follow.
Use the same formula in Indicator Builder or Interpretation
window.
Dimitris Tsokakis
[to be continued]
Yahoo! Groups Sponsor
ADVERTISEMENT
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Attachment:
PredictI.gif
Attachment:
Description: "Description: GIF image"
|