PureBytes Links
Trading Reference Links
|
Herman,
thank you for comments/additions.
The tread will be interesting by the end. A lot of calculations are
waiting .
The statistics are also satisfactory.
As for the frequency, it depends, among the others, on MA period. MA
crossover traders will have a clear signal one [valuable] bar
earlier.
I am sure you will discover more applications soon.
Yuki and Jason discussion was the main reason to organise some old
formulas and begin this thread. This is [I hope] the great spirit of
this list :Co-operation for the common benefit.
Your next comments/suggestions are appreciated.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "Herman van den Bergen"
<psytek@xxxx> wrote:
> Nice work DT!
>
> I added a few columns to your code to show how often your
predictions occur
> and to show final stats for watch lists instead of single stocks.
>
> Filter=Status("LastBarInTest");
> SetOption("NoDefaultColumns",False);
> AddColumn(BarCount,"BarCount",1.0);
> AddColumn(DescTotalPredictions,"DescTotalPredictions",1.0);
> AddColumn
(BarCount/DescTotalPredictions,"AvePredictionInterval",1.0);
>
> Best regards,
> herman.
> -----Original Message-----
> From: Dimitris Tsokakis [mailto:TSOKAKIS@x...]
> Sent: Wednesday, July 16, 2003 4:05 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Fw: Predictions I
>
>
> The condition
> DescCrossPrediction=Cross(tClose,C);
> predicts that a Descending MA cross will occur tomorrow.
> It will be named
>
> Accurate0DescPredictions, if it is confirmed tomorrow
> Accurate1DescPredictions, if it is confirmed 1 day later
> Accurate2DescPredictions, if it is confirmed 2 days later
> UselessDescPredictions, if it is simultaneous with the prediction
> False, if it does not belong in one above category.
>
> [Last bar predictions are also considered as false, although the
majority
> will be confirmed tomorrow...]
> Similar terminology is used for the Ascending crosses.
> The N100 results from Jan2000 till now are enthusiastic and, in
practical
> terms, we may say that we can have a safe prediction
> for the [unknown] next bar MA cross.
> Explore your database for the n=1 last quotations with
>
> // MA cross Prediction Statistics, by Dimitris Tsokakis, July 2003
> p=20;MAp=MA(C,p);
> k=30;MAk=MA(C,k);
> y=p*MA(C,p)-(p-1)*Ref(MA(C,p-1),-1);
> 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);
> DescTotalPredictions=Cum(DescCrossPrediction);
> Accurate0DescPredictions=Cum(ConfirmedDesc AND
> Ref(DescCrossPrediction,-1));
> Accurate1DescPredictions=Cum(ConfirmedDesc AND
> Ref(DescCrossPrediction,-2));
> Accurate2DescPredictions=Cum(ConfirmedDesc AND
> Ref(DescCrossPrediction,-3));
> UselessDescPredictions=Cum(ConfirmedDesc AND DescCrossPrediction);
> AscTotalPredictions=Cum(AscCrossPrediction);
> Accurate0AscPredictions=Cum(ConfirmedAsc AND Ref
(AscCrossPrediction,-1));
> Accurate1AscPredictions=Cum(ConfirmedAsc AND Ref
(AscCrossPrediction,-2));
> Accurate2AscPredictions=Cum(ConfirmedAsc AND Ref
(AscCrossPrediction,-3));
> UselessAscPredictions=Cum(ConfirmedAsc AND AscCrossPrediction);
> Filter=1;
> AddColumn(100*Accurate0DescPredictions/DescTotalPredictions,"Acc0
Desc
> %",1.0);
> AddColumn(100*Accurate1DescPredictions/DescTotalPredictions,"Acc1
Desc
> %",1.0);
> AddColumn(100*Accurate2DescPredictions/DescTotalPredictions,"Acc2
Desc
> %",1.0);
> AddColumn
(100*UselessDescPredictions/DescTotalPredictions,"Useless Desc
> %",1.0);
> AddColumn(100-Column0-Column1-Column2-Column3,"False Desc %",1.0);
> AddColumn(100*Accurate0AscPredictions/AscTotalPredictions,"Acc0
Asc
> %",1.0);
> AddColumn(100*Accurate1AscPredictions/AscTotalPredictions,"Acc1
Asc
> %",1.0);
> AddColumn(100*Accurate2AscPredictions/AscTotalPredictions,"Acc2
Asc
> %",1.0);
> AddColumn(100*UselessAscPredictions/AscTotalPredictions,"Useless
Asc
> %",1.0);
> AddColumn(100-Column5-Column6-Column7-Column8,"False Asc %",1.0);
>
>
> ----- Original Message -----
> From: Dimitris Tsokakis
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Tuesday, July 15, 2003 5:35 PM
> Subject: Predictions I
>
>
> 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
> 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=AscCrossPrediction OR DescCrossPrediction;
> to see the predictions for tomorrow, or with the
> Filter=Ref(AscCrossPrediction OR DescCrossPrediction,-1);
> 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@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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.
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/sOykFB/k9VGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->
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 http://docs.yahoo.com/info/terms/
|