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

[amibroker] Re: Problem with Equity Plot - TJ



PureBytes Links

Trading Reference Links

I don't know if this is related or not, but I've also had trouble with
equity plots.  It's happened when plotting three or more systems'
equity lines as a single "indicator" in IB to get them all in the same
pane for comparison. I noticed that sometimes one of the equity lines
in a multiple equity line plot would differ from the exact same code
plotted by itself in another pane.  Unfortunately, instead of saving
the code I deleted it and just stopped doing it.

Mark

--- In amibroker@xxxxxxxxxxxxxxx, "Bill Barnard" <wbarnard@xxxx> wrote:
> I have noticed a problem with the way equity is plotted after a Back
Test run. It seems that the equity plot starts moving away from the
initial value only after the first buy or sell subsequent to the
starting date of the test run, rather than at the start (with delay
set to 0).  Here is the code for the equity line for a simple moving
average cross-over trading system which I am running from 2/23/2001 to
7/10/2003.
> -----------------------------------------------------------------------
> SetTradeDelays(0,0,0,0);
> ApplyStop(0,0,0,0); ApplyStop(1,0,0,0); ApplyStop(2,0,0,0);
> BuyPrice=SellPrice=ShortPrice=CoverPrice=C;
> 
> Buy = Cross(Close, (1 + 0.002)*EMA(Close, 40));
> Sell = Cross((1 - 0.002)*EMA(Close, 40), Close);
> 
> Short = Sell;  Cover = Buy;
> Buy  = ExRem(Buy,Sell); Sell = ExRem(Sell, Buy); 
> Short = ExRem(Short, Cover); Cover = ExRem(Cover, Short);
> 
> /**/
> //--equity-plot-- do not remove this line
> MaxGraph=0;GraphXSpace=5;
> GraphZOrder=1;
> Plot( Equity( 0, -2 ), "Equity", 1, styleArea );
> 
> /* now buy and hold simulation */
> Short=Cover=0;
> Buy=Status("firstbarintest");
> Sell=Status("lastbarintest");
> SetTradeDelays(0,0,0,0); PositionSize = -100;
> ApplyStop(0,0,0,0);
> ApplyStop(1,0,0,0);
> ApplyStop(2,0,0,0);
> Plot( Equity( 0, -2 ), "Buy&Hold", 0);
> ------------------------------------------------------------------------
> On the attached plot (sorry about using JPG, but I couldn't get the
detail to show well enough in a PNG), the bottom panel shows the
Equity Plot and the middle panel shows the trading code run in IB with
arrows added to indicate the Buys and Sells. Note that with the test
starting at the pole, 2/23/2001, which is a few days after a Sell, the
Equity does not start following the price line until after the next
subsequent signal, 37 days later on 4/18/2001. Also, the results
window at the bottom of AA shows the Trade to be "Out" until
4/18/2001, at which time it goes to "Long."
> 
> I have made a fairly complicated work-around, but I am thinking that
I must have something wrong; surely AB should start the equity
calculation and plot right away. Any help or comment appreciated.
> 
> Bill


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Free shipping on all inkjet cartridge & refill kit orders to US & Canada.
We have your brand: HP, Epson, Lexmark, Canon & more.
http://www.c1tracking.com/l.asp?cid=5510
http://us.click.yahoo.com/kP..SB/49VGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 http://docs.yahoo.com/info/terms/