[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Calculating Stats



PureBytes Links

Trading Reference Links




Eugene and Dom
 
I have attached an image showing the 
pattern...
 
DOM: ( yes...I have your formula completed...except 
I am stuck with returning 2 values..min and max values....).
 
Try this:
load into AA....n last quotations and n=1...click 
explore.
 

// setup P<FONT 
color=#ff0000 size=2>attern
pat=Ref(C,-<FONT 
face="Courier New" color=#ff00ff size=2>5<FONT 
size=2>)>Ref<FONT 
size=2>(C,-<FONT face="Courier New" color=#ff00ff 
size=2>4)AND <FONT color=#0000ff 
size=2>Ref(C,-<FONT face="Courier New" 
color=#ff00ff size=2>3)<<FONT color=#0000ff 
size=2>Ref(C,-<FONT face="Courier New" 
color=#ff00ff size=2>4) AND <FONT color=#0000ff 
size=2>Ref(C,-<FONT face="Courier New" 
color=#ff00ff size=2>2)><FONT color=#0000ff 
size=2>Ref(C,-<FONT face="Courier New" 
color=#ff00ff size=2>3) AND <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>1)><FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>2) AND C ><FONT face="Courier New" 
size=2> Ref<FONT 
size=2>(C,-1<FONT 
size=2>);
<FONT 
size=2>/*********************************************************/<FONT 
color=#ff0000 size=2>
// # of patterns
pat1=Cum<FONT 
size=2>(pat);
//# of bars
bars=Cum<FONT 
size=2>(1<FONT 
size=2>);
//% Pattern
Cond1=(Cum<FONT 
size=2>(pat)/Cum<FONT 
size=2>(1<FONT 
size=2>))*100<FONT 
size=2>;
/************************************/<FONT face="Courier New" 
color=#ff0000 size=2>
//# Wins
// 1 day up after 
pattern
Day1up=Cum<FONT 
size=2>(Ref<FONT 
size=2>(pat,-1) AND 
C> Ref<FONT 
size=2>(C,-1<FONT 
size=2>));
// 2 days up after pattern
Day2up=Cum<FONT 
size=2>(Ref<FONT 
size=2>(pat,-2) AND 
Ref(C,-<FONT 
color=#ff00ff size=2>1)><FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>2) AND C> <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>1));//2 days 
up
// 3 days up after pattern
Day3up=Cum<FONT 
size=2>(Ref<FONT 
size=2>(pat,-3) AND 
Ref(C,-<FONT 
color=#ff00ff size=2>2)><FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>3) AND <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>1)> <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>2)AND C > <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>1));//3 days 
up
// 4 days up after pattern
Day4up=Cum<FONT 
size=2>(Ref<FONT 
size=2>(pat,-4) AND 
Ref(C,-<FONT 
color=#ff00ff size=2>3)><FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>4) AND <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>2)> <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>3)AND <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>1) > <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>2)AND C > <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>1));//4 days 
up
 
// % wins
Day1upPercent=(<FONT color=#0000ff 
size=2>Cum(Ref<FONT 
size=2>(pat,-1) AND 
C > Ref<FONT 
size=2>(C,-1<FONT 
size=2>))/Cum<FONT 
size=2>(pat))*100<FONT 
size=2>;
Day2upPercent=(<FONT color=#0000ff 
size=2>Cum(Ref<FONT 
size=2>(pat,-2) AND 
Ref(C,-<FONT 
color=#ff00ff size=2>1)><FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>2) AND C> <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>1))/<FONT color=#0000ff 
size=2>Cum(pat))*<FONT color=#ff00ff 
size=2>100;<FONT 
size=2>
Day3upPercent=(Cum<FONT 
size=2>(Ref<FONT 
size=2>(pat,-3) AND 
Ref(C,-<FONT 
color=#ff00ff size=2>2)><FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>3) AND <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>1)> <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>2)AND C > <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>1))<FONT face="Courier New" 
size=2>/Cum<FONT 
size=2>(pat))*100<FONT 
size=2>;
Day4upPercent=(Cum<FONT 
size=2>(Ref<FONT 
size=2>(pat,-4) AND 
Ref(C,-<FONT 
color=#ff00ff size=2>3)><FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>4) AND <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>2)> <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>3)AND <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>1) > <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>2)AND C > <FONT color=#0000ff 
size=2>Ref(C,-<FONT color=#ff00ff 
size=2>1))<FONT face="Courier New" 
size=2>/Cum<FONT 
size=2>(pat))*100<FONT 
size=2>;
 
Filter=1<FONT 
size=2>;
AddColumn(pat1,<FONT color=#ff00ff 
size=2>"#Pat",<FONT color=#ff00ff 
size=2>1);
AddColumn(bars,<FONT color=#ff00ff 
size=2>"#Bars",<FONT color=#ff00ff 
size=2>1);
AddColumn(Cond1,<FONT color=#ff00ff 
size=2>"%Pat",<FONT color=#ff00ff 
size=2>1.2);
AddColumn(Day1up,<FONT color=#ff00ff 
size=2>"#1up<FONT 
color=#ff00ff size=2>",<FONT color=#ff00ff 
size=2>1);
AddColumn(Day1upPercent,<FONT color=#ff00ff 
size=2>"%<FONT face="Courier New" color=#ff00ff 
size=2>1up",<FONT color=#ff00ff 
size=2>1.2);
AddColumn(Day2up,<FONT color=#ff00ff 
size=2>"#2up<FONT 
color=#ff00ff size=2>",<FONT color=#ff00ff 
size=2>1);
AddColumn(Day2upPercent,<FONT color=#ff00ff 
size=2>"%2up<FONT 
color=#ff00ff size=2>",<FONT color=#ff00ff 
size=2>1.2);
AddColumn(Day3up,<FONT color=#ff00ff 
size=2>"#3up<FONT 
color=#ff00ff size=2>",<FONT color=#ff00ff 
size=2>1);<FONT face="Courier New" 
color=#0000ff size=2>
AddColumn(<FONT 
size=2>Day3<FONT 
size=2>upPercent,"%<FONT 
face="Courier New" color=#ff00ff size=2>3<FONT color=#ff00ff 
size=2>up",<FONT color=#ff00ff 
size=2>1.2);
AddColumn(Day4up,<FONT color=#ff00ff 
size=2>"#4up<FONT 
color=#ff00ff size=2>",<FONT color=#ff00ff 
size=2>1);<FONT face="Courier New" 
color=#0000ff size=2>
AddColumn<FONT face="Courier New" 
size=2>(Day4upPercent,<FONT face="Courier New" color=#ff00ff 
size=2>"%4up",<FONT 
face="Courier New" color=#ff00ff size=2>1.2<FONT face="Courier New" 
size=2>);<FONT face=Arial color=#000000 
size=2>
 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  dom1_1998 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Tuesday, July 08, 2003 9:08 
AM
  Subject: [amibroker] Re: Calculating 
  Stats
  I'm going to take a WAG at saying this.  But I think 
  Eugene may wantto know, at least I do, what's the performance if held 1 
  day after thecondition, 2 days after, 3 days after etc etc up to the 5th 
  day aftersaid cond.Dominick
  Send BUG REPORTS to <A 
  href="">bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 
  
<BLOCKQUOTE 
><FONT 
  face="Courier New">---Outgoing mail is certified Virus 
  Free.Checked by AVG anti-virus system (<A 
  href="">http://www.grisoft.com).Version: 6.0.498 
  / Virus Database: 297 - Release Date: 7/9/2003






Yahoo! Groups Sponsor












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:
eugene.JPG

Attachment: Description: "Description: JPEG image"