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

Better equity Curve?



PureBytes Links

Trading Reference Links

Happy trading,
Herman



/*Insert your trading system here*/
E = Equity(1);
Investment = 100;
dBuy = Ref( Buy,-1);dSell = Ref( Sell,-1); //Delayed signals for
code brevity
dShort = Ref(Short,-1);dCover = Ref(Cover,-1);
X = dSell OR dCover;
EntryEquity = ValueWhen(dbuy OR dshort,E);
ExitEquity = ValueWhen(dSell OR dCover,E);
C = IIf(dSell OR dCover,EntryEquity,-1e10);
O = IIf(dSell OR dCover,Ref(ExitEquity,-1),-1e10);
LowestTEquity =
IIf(dSell,
LowestSince(dBuy,E),IIf(dCover,LowestSince(dShort,E),0));
L = IIf(dSell OR dCover,LowestTEquity,-1e10);
HighestTEquity =
IIf(dSell,
HighestSince(dBuy,E),IIf(dCover,HighestSince(dShort,E),0));
H = IIf(dSell OR dCover,HighestTEquity,-1e10);
Plot(IIf(dSell OR dCover,C,-1e10),"TradeBars for "+Name(),2,64);
Plot(E,"E",0,1);
Title =
"\\c02Trade Equity Bars for "+Name()+". Final equity = "+
WriteVal(LastValue(E),1.2)+"
("+WriteVal((LastValue(E)-investment)/investment*100,1.2)+"%)"+
WriteIf(X,
"\nTradeProfit: "+WriteVal(C-O,1.2)+"
("+WriteVal((C-O)/O*100,1.2)+"%)"+
"\nEntryEquity: "+WriteVal(O,1.2)+
"\nExitEquity: "+WriteVal(C,1.2)+
"\nProfitPotential: "+WriteVal(H-O,1.2)+"
("+WriteVal((H-O)/O*100,1.2)+"%)"+
"\nMissedProfit: "+WriteVal(H-C,1.2)+"
("+WriteVal((H-C)/O*100,1.2)+"%)"+
"\nEquityRange: "+WriteVal(H-L,1.2)+"
("+WriteVal((H-L)/O*100,1.2)+"%)"
,"\nTradeProfit: "+WriteVal(E-EntryEquity,1.2)+"
("+WriteVal((E-EntryEquity)/EntryEquity*100,1.2)+"%)");
GraphXSpace = 5; /*


------=_NextPart_001_0001_01C2801E.ED2B3040
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META content=3D"text/html; charset=3Diso-8859-1" http-equiv=3DContent-Type=
>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR></HEAD>
<BODY>
<P><FONT size=3D2>Hello, in an attempt to make the standard, tell-nothing, =
equity=20
chart more revealing I began using TradeEquityBars. They are candlesticks t=
hat=20
show trade information: Green for winning, Red for losing, and shadows to=20
indicate the Equity Highs and Lows during the trade. Together with a price =
chart=20
with trade signals it gives a better visual representation of trading activ=
ity.=20
Modify the code below to meet your requirements.</FONT></P>
<P><FONT size=3D2>Happy trading,<BR>Herman<BR><BR><FONT face=3DArial><FONT=
=20
face=3DArial size=3D2><SPAN class=3D950560119-30102002><IMG align=3Dbaselin=
e alt=3D""=20
border=3D0 hspace=3D0=20
src=3D"cid:950560119@xxxx";></SPAN></FONT></FONT><BR><BR>/*Insert y=
our=20
trading system here*/<BR>E =3D Equity(1);<BR>Investment =3D 100;<BR>dBuy =
=3D Ref(=20
Buy,-1);dSell =3D Ref( Sell,-1); //Delayed signals for code brevity<BR>dSho=
rt =3D=20
Ref(Short,-1);dCover =3D Ref(Cover,-1);<BR>X =3D dSell OR dCover;<BR>EntryE=
quity =3D=20
ValueWhen(dbuy OR dshort,E);<BR>ExitEquity =3D ValueWhen(dSell OR dCover,E)=
;<BR>C=20
=3D IIf(dSell OR dCover,EntryEquity,-1e10);<BR>O =3D IIf(dSell OR=20
dCover,Ref(ExitEquity,-1),-1e10);<BR>LowestTEquity =3D<BR>IIf(dSell,=20
LowestSince(dBuy,E),IIf(dCover,LowestSince(dShort,E),0));<BR>L =3D IIf(dSel=
l OR=20
dCover,LowestTEquity,-1e10);<BR>HighestTEquity =3D<BR>IIf(dSell,=20
HighestSince(dBuy,E),IIf(dCover,HighestSince(dShort,E),0));<BR>H =3D IIf(dS=
ell OR=20
dCover,HighestTEquity,-1e10);<BR>Plot(IIf(dSell OR dCover,C,-1e10),"TradeBa=
rs=20
for "+Name(),2,64);<BR>Plot(E,"E",0,1);<BR>Title =3D<BR>"\\c02Trade Equity =
Bars=20
for "+Name()+". Final equity =3D "+ WriteVal(LastValue(E),1.2)+"=20
("+WriteVal((LastValue(E)-investment)/investment*100,1.2)+"%)"+<BR>WriteIf(=
X,<BR>"\nTradeProfit:=20
"+WriteVal(C-O,1.2)+" ("+WriteVal((C-O)/O*100,1.2)+"%)"+<BR>"\nEntryEquity:=
=20
"+WriteVal(O,1.2)+<BR>"\nExitEquity: "+WriteVal(C,1.2)+<BR>"\nProfitPotenti=
al:=20
"+WriteVal(H-O,1.2)+" ("+WriteVal((H-O)/O*100,1.2)+"%)"+<BR>"\nMissedProfit=
:=20
"+WriteVal(H-C,1.2)+" ("+WriteVal((H-C)/O*100,1.2)+"%)"+<BR>"\nEquityRange:=
=20
"+WriteVal(H-L,1.2)+" ("+WriteVal((H-L)/O*100,1.2)+"%)"<BR>,"\nTradeProfit:=
=20
"+WriteVal(E-EntryEquity,1.2)+"=20
("+WriteVal((E-EntryEquity)/EntryEquity*100,1.2)+"%)");<BR>GraphXSpace =3D =
5;=20
/*</FONT> </P></BODY></HTML>

------=_NextPart_001_0001_01C2801E.ED2B3040--

Attachment: Description: ""