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

[amibroker] Re: AddToComposite issues



PureBytes Links

Trading Reference Links

> AddToComposite(Equity()-10000, "~Composite", "X");  
> // (where 10000 is the starting capital).

Chuck,

See comments below.

b

--- In amibroker@xxxxxxxxxxxxxxx, "Chuck Rademacher" 
<chuck_rademacher@x> wrote:
> This is a continuation of a thread on 
> "optimizing issues", but I changed the
> subject to narrow in on a specific question.
> 
> "b" advises (see below) that if I am 
> running an optimization across 7,500
> stocks and using AddToComosite as described 
> below, the value of my composite
> will grow purely from the fact that new 
> stocks are coming into the basket
> every few weeks.  At least I think this 
> summarises what he told me.  It also
> explains why I got excited looking at my 
> equity curve.

YES, THAT IS WHAT I THINK THE PROBLEM MIGHT BE.

> 
> I am using this statement:   
> AddToComposite (Equity(), "~`Composite", "X");
> 
> What I really want to see is a "profit" 
> curve, not an "equity" curve.  Plus,
> I don't want the equity curve to grow all 
> by itself as new stocks come into
> the mix as I'm looking at 15 years of data.
> 
> I tested the following for myself and it 
> appears to work, but does anyone
> see a problem using the following statement 
> to achieve my objective?
> 
> AddToComposite(Equity()-10000, "~Composite", "X");  
> // (where 10000 is the starting capital).

THAT SHOULD GIVE YOU THE PROFIT CURVE. IT WILL BE ACCURATE WHEN 
TESTING A SINGLE STOCK OR INDEX, BUT WHEN TESTING A BASKET OF STOCKS 
IT WILL HAVE THE SAME PROBLEM AS YOUR PREVIOUS FORMULA.

> A secondary question... is there a system 
> variable that will tell me the
> initial capital?   I don't really want to 
> hard code it in my statement.
> Yes, I did look first, but couldn't find it.

I THINK YOU COULD USE AB'S BUILT IN EQUITY() FUNCTION TO GET THE 
INITIAL EQUITY. YOU MIGHT WANT TO USE AB'S REF(EQUITY(), -1) TO GET 
YESTERDAY'S EQUITY. USING YESTERDAY'S EQUITY WOULD BE THE WAY TO GO 
IF YOUR SYSTEM CALLS FOR AN ENTRY AT THE OPEN AND IF THE EQUITY IS 
CALCULATED BASED ON THE CLOSING PRICE (A BIT OF A LOOK AHEAD ISSUE). 
USING YESTERDAY'S EQUITY SHOULD AVOID THAT DANGER.

PERHAPS OTHERS WHO ARE MORE FAMILIAR WITH EQUITY() CALLS MIGHT ADD 
SOME INSIGHT ON WHETHER OR NOT YOU NEED TO WATCH OUT FOR FEED BACK 
LOOPS DEPENDING ON WHERE THE EQUITY() IS PLACED IN THE AFL CODE. 

B

> Thanks!!
> 



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/