PureBytes Links
Trading Reference Links
|
At 3:00 PM -0500 12/15/00, John T. Nelson wrote:
>Forgive me if this is a stupid question. The systems report
>which shows you the number of successful trades, failed trades,
>percentage drawdown, etc and this is all very useful. But now
>I would like to dientify specifically those trades which failed
>on the chart which contains the system.
>
>You see, it would be very helpful to me to know exactly *where*
>those systems succeed or fail. If I can identify the conditions
>under which these systems fail then I can improve them or at least
>eyeball the chart and say "oh that system failed the last time in
>a trending market so I should discount that signal."
>
>Any way in Supercharts to do that?
Attached is an indicator I wrote in 1997 that will do that. The
EasyLanguage code is listed below and the ELA file, which should work
in SuperCharts, is attached.
The documentation on how to use it is in the code below.
Bob Fulks
{ *******************************************************************
Indicator : Equity Trace
Last Edit : 11/29/97
Provided By : Bob Fulks
Description : This indicator plots bars of equity for each trade
of a system. It is run separately and determines the values
based upon the System that is running,
There are three modes of operation as determined by the
input, "Mode":
Mode Description
0 Plots the equity buildup on each bar as the
trade progresses (the default case).
1 Plots on the bar of ENTRY, the total equity
change due to the completed trade . This
is useful in tracing the profitability of
entry signals.
2 Plots on the bar of EXIT, the total equity
change due to the completed trade . This
is useful in tracing the profitability of
completed trades.
Scaling is determined by the True/False input, "Percent":
Percent Description
True Plots the bars as a percent increase or
decrease of the total investment (as determined
by I_AveEntryPrice * I_CurrentContracts)). Thus
a green bar 15 high would indicate a profit-
ability of 15% on the initial investment as
of that bar (the default case).
False Plots the bars in units of price (as determined
by I_OpenEquity functions).
Positive values are plotted up in green, negative values
plotted down in red. The indicator also plots a yellow dot on
the final equity value.
Styles recommended:
Plot1("Loss"); Red histogram
Plot2("Gain"); Green histogram
Plot3("Final"); White point
Plot4("Zero"); Dark gray
© 1997 Robert G. Fulks. All rights reserved.
********************************************************************}
Inputs: Mode(0), Percent(FALSE);
Vars: CE(0), {Closed equity in dollars or %}
TE(0), {Trade equity in dollars or %}
MP(0), {Market position}
BSE(0), {Bars since entry}
Offset(0), {Offset for plotting}
Invest(0); {Dollars invested in trade}
MP = I_MarketPosition; {Get market position}
BSE = iff(MP <> MP[1], 1, BSE + 1); {Calculate bars since entry}
Offset = iff(Mode = 1, BSE[1], 0); {Calculate offset for plot}
CE = I_ClosedEquity; {Calc closed equity}
TE = I_OpenEquity - I_ClosedEquity; {Calc trade equity}
{Calculate total investment}
Value3 = I_AvgEntryPrice * I_CurrentContracts;
Invest = iff(Value3 <> 0, Value3, Invest[1]);
Value1 = CE - CE[1]; {Calculate closed equity}
Value2 = TE; {Calculate trade equity}
{Scale values if in "Percent" mode}
if Percent then begin
Value1 = iff(Invest <> 0, 100 * Value1 / Invest, Value1[1]);
Value2 = iff(Invest <> 0, 100 * Value2 / Invest, Value2[1]);
end;
{Plot TradeEquity}
if Mode = 0 and Value2 < 0 then {Plot losers in red}
Plot1(Value2,"Loss");
if Mode = 0 and Value2 > 0 then {Plot winners in green}
Plot2(Value2,"Gain");
{Plot Closing Equity}
if Value1 < 0 then begin {Plot losers in red}
Plot1[Offset](Value1,"Loss");
Plot3[Offset](Value1,"Final");
end;
if Value1 > 0 then begin {Plot winners in green}
Plot2[Offset](Value1,"Gain");
Plot3[Offset](Value1,"Final");
end;
Plot4(0, "Zero"); {Plot baseline}
Attachment:
Description: "EQTRACE.ELA"
Attachment:
Description: "%EQTRACE.ELA"
|