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

[amibroker] Re: AddToComposite issues (for Chuck)



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, "Chuck Rademacher" 
<chuck_rademacher@x> wrote:
> 
> I've tested this pretty thoroughly and it 
> seems to work fine, even with two,
> ten, twenty stocks.  I assume,  therefore, 
> that it will work with 7,500.

I am surprised. Perhaps I have more to learn about how Equity() and 
AddtoComposite interact. One question comes to mind -- Did the 
prototype stocks have different data histories? If the prototype 
stocks all started in the same year then the potential problem would 
not show up.

Perhaps the way to determine if there is a problem or not is to 
devise code that should make trades that one could set to record a 
consistent profit. For example,

BuyPrice = 100;
SellPrice = 100;
Buy = 1; //will enter each and every stock
Sell = 0; //ApplyStop will do the exiting
ApplyStop( stopTypeNBar, stopModeBars, 20 );//exit after 20 bars
...your addtocomposite equity code...

The above should produce a completely flat equity curve (assuming 
trading fees are set to zero). If the curve rises it can only be due 
to the number of new trades getting added to the composite as times 
go by.

The above could be varied to determine if the composite equity is 
behaving properly when the trades are profitable.

BuyPrice = 100;
SellPrice = 105;// 5% gain per trade.

And when the trades are not profitable.

BuyPrice = 100;
SellPrice = 95; // 5% loss per trade.

If you do more testing, I would be interested to hear what you 
discover about how Equity() interacts with AddToComposite.

b

--- In amibroker@xxxxxxxxxxxxxxx, "Chuck Rademacher" 
<chuck_rademacher@x> wrote:
>  You said:
> 
>  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.
> 
> 
> My comment:
> 
> I've tested this pretty thoroughly and it seems to work fine, even 
with two,
> ten, twenty stocks.  I assume,  therefore, that it will work with 
7,500.
> By doing this:
> 
> AddToComposite (equity()-10000,........
> 
> it adds the cumulative profit or loss to the composite which is 
what I
> expect to see.
> 
> I tried doing this:
> 
> AddToComposite (equity() - ref(equity(),-1).....
> 
> But, for some reason, it keeps resetting the composite to zero 
along the
> way.
> 
> 
> I have been using your favourite metric (average trade) and it 
works well.
> The problem is that if the system lost money for eight years and 
made money
> for the last seven years (or vice versa), I can't see that 
reflected in any
> of the metrics.  I really need to see a proift or equity curve.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
New Yahoo! Mail Plus. More flexibility. More control. More power.
Get POP access, more storage, more filters, and more.
http://us.click.yahoo.com/Hcb0iA/P.iFAA/46VHAA/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/