For metastock users, I'm posting the equity curve indicator:
Equity Long $:
a:= Buy condition;
b:= Exit Condition;
d:= BarsSince(a) = 2;
f:= BarsSince(b) = 1;
g:= BarsSince(d) < BarsSince(f);
i:= ROC(C,1,$);
j:= If(g,i,0);
k:= Cum(j);
k
Equity Short $:
a:= Short condition;
b:= Exit Short condition;
d:= BarsSince(a) = 2;
f:= BarsSince(b) = 1;
g:= BarsSince(d) < BarsSince(f);
i:= ROC(C,1,$);
j:= If(g,-i,0);
k:= Cum(j);
k
Equity total $:
a:= Fml("Equity Long $");
b:= Fml("Equity Short $");
a + b
I coded this formula myself, after being quite upset with metastock's backtester. You can incorporate brokerages by using the "valuewhen"
function. Longs, shorts and exits are based on next day's close.
Equity Long $:
a:= Buy condition;
b:= Exit Condition;
d:= BarsSince(a) = 2;
f:= BarsSince(b) = 1;
g:= BarsSince(d) < BarsSince(f);
i:= ROC(C,1,$);
j:= If(g,i,0);
k:= Cum(j);
k
Equity Short $:
a:= Short condition;
b:= Exit Short condition;
d:= BarsSince(a) = 2;
f:= BarsSince(b) = 1;
g:= BarsSince(d) < BarsSince(f);
i:= ROC(C,1,$);
j:= If(g,-i,0);
k:= Cum(j);
k
Equity total $:
a:= Fml("Equity Long $");
b:= Fml("Equity Short $");
a + b
I coded this formula myself, after being quite upset with metastock's backtester. You can incorporate brokerages by using the "valuewhen"
function. Longs, shorts and exits are based on next day's close.