I have waited from 21st April so the sender of this pm (on my request he designed this back-test in Metastock) can post the same in the Thread.In subsequent pm's he requested that this be posted as an 'anonymus ID'.
After thinking for 7 days ,without his permission i am posting the same.
" 21st April 2008, 05:37 PM
oxusmorouz
Member Join Date: Sep 2006
Location: Chennai
Posts: 744
Re: Plz Test this
--------------------------------------------------------------------------------
Hello sir,
Since there's a pretty easy exam tomorrow, thought I'll take an hour off for surfing. Added something I've been working on recently. It's for long only positional trading and "not for any lesser time frame". Shall work on adding another filter later.
Indicator name: Calcutta Indicator:
Quote:
K:= C;
a:=30;
S1:=Sin(1*a)*K;
S2:=Sin(2*a)*Ref(K,-1);
S3:=Sin(3*a)*Ref(K,-2);
S4:=Sin(4*a)*Ref(K,-3);
S5:=Sin(5*a)*Ref(K,-4);
Num:=S1+S2+S3+S4+S5;
Den:=Sin(a)+Sin(2*a)+Sin(3*a)+Sin(4*a)+Sin(5*a);
j1:= Num/Den;
j1;
Indicator name: Calcutta Secondary Buy
Quote:
a:= Fml("Calcutta Indicator");
Cross(C,a);
Indicator name: Calcutta Secondary Sell
Quote:
a:= Fml("Calcutta Indicator");
Cross(a,C);
Indicator name: Calcutta System - Equity $
Quote:
EntryPrice:= BarsSince(Fml("Calcutta Secondary Buy")) = 1;
ExitPrice:= BarsSince(Fml("Calcutta Secondary Sell")) = 1;
a:= Cum(Cum(entryprice) * ROC(C,1,$));
b:= Cum(Cum(exitprice) * ROC(C,1,$));
a - b
Indicator name: Calcutta Buy-Hold
Quote:
a:= Fml("Calcutta System - Equity $");
b:= IsDefined(a);
d:= If(b = 1, ROC(C,1,$),0);
Cum(d)
Indicator name: Calcutta - ROC Difference
Quote:
a:= Fml("Calcutta System - Equity $");
b:= Fml( "Calcutta Buy-Hold");
d:= (a-b);
f:= Mov(d,5,S);
f
Indicator name: Calcutta System - Primary Buy
Quote:
a:= Fml( "Calcutta Secondary Buy");
b:= Fml( "Calcutta Secondary Sell");
d:= Fml( "Calcutta - ROC Difference");
f:= IsDefined(d);
g:= BarsSince(f = 1 AND Ref(f,-2) = 0) = 1;
i:= d < 0 AND g;
j:= (d > 0 AND a) OR (BarsSince(a) < BarsSince(b) AND g);
k:= Cross(0,d);
i OR j OR k
Indicator name: Calcutta System - Primary Sell
Quote:
a:= Fml( "Calcutta Secondary Buy");
b:= Fml( "Calcutta Secondary Sell");
d:= Fml( "Calcutta - ROC Difference");
f:= IsDefined(d);
g:= BarsSince(f = 1 AND Ref(f,-2) = 0) = 1;
i:= d < 0 AND g;
j:= (d > 0 AND a) OR (BarsSince(a) < BarsSince(b) AND g);
k:= Cross(0,d);
m:= i OR j OR k;
n:= BarsSince(a) > BarsSince(b) AND Cross(d,0);
q:= d > 0 AND b;
r:= g AND BarsSince(b) < BarsSince(a);
n OR q OR r
Indicator name: Calcutta System - Total Equity $
Quote:
a:= Fml( "Calcutta System - Primary Buy") ;
b:= Fml( "Calcutta System - Primary Sell");
d:= BarsSince(a) = 1;
f:= BarsSince(b) = 1;
g:= BarsSince(d) < BarsSince(f);
i:= ROC(C,1,$);
j:= If(g,i,0);
k:= Cum(j);
k
Your comments/feedback will be appreciated.
Regards,
Ajay. "
Plz change the name from Calcutta Indicator to whatever name is there in your Metastock;as name ,for the Original indicator,becoz it is going to be Called by Ajay's code ,time & again.