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

[amibroker] Re: Looking at composites as you are building them...



PureBytes Links

Trading Reference Links

Chuck -

I've run into the same problem.  One of us should detail this to 
Tomasz.  I believe that it may be a bug in that the composite seems 
to be cached and not refreshed when it is written.  I was trying to 
use composites for something different related to optimization and 
hit the issues a couple of weeks ago.

I've been catching up on the posts and have seen yours regarding 
construction of the portfolio equity and the problems related to 
different start dates, and also the effect of issues being removed.

The other issue, is that as individual issues are traded, the equity 
is compounded and the amount invested in individual issues varies 
widely.  In practice, one would re-balance.

I believe that there is really no good answer without a true trading 
module that can hold the top "N" issues and rebalance.  This more 
closely simulates what we do as investors with limited capital.

I'm not sure where you are trying to end up, but I'll offer that an 
approach used by the FT/Trade folks is to assume a daily rebalance of 
equity among the filtered issues.  It turns out that this result is 
not too far different from what one might do in practice in a 
periodic rebalance.  If it would fit and you would like details, 
please advise.  It is easy to simulate in Amibroker.


Bruce Robinson


--- In amibroker@xxxxxxxxxxxxxxx, "Chuck Rademacher" 
<chuck_rademacher@x> wrote:
> MessageI have written some logic that will AddToComposte the capital
> required to trade.   Let's say that I have a system that trades 
IBM, long
> only, and buys every January and sells every June.  I'm trying to 
keep it
> simple.   If the system trades $10,000, I will need $10,000 to 
trade IBM for
> January through May and I won't need any capital for the rest of 
the year.
> The system will take long positions in other stocks during 
different months.
> My composite, therefore, will show me how much capital is required 
to take
> every trade over the period in my backtest.   This all seems to 
work fine.
> 
> I then tried to modify the program so that it looks at the 
composite as it
> is being built.  The objective is to stop taking new signals when I 
run out
> of cash.  The code looks like:
> 
> TotalCapitalRequired = Foreign("~Capital","Close",fixup=1);
> 
> I then might say something like:
> 
> Buy = Close > MA(Close,50) and TotalCapitalRequired < 100000;
> 
> 
> This doesn't seem to work.   It still takes every trade and the 
capital
> composite keeps growing well past the 100,000 mark.
> 
> I tried this:
> 
> TotalCapitalRequired = ref(Foreign("~Capital","Close",fixup=1),-1);
> 
> It didn't do the job either.
> 
> This is probably a question for TJ, but is it possible to access the
> composite as it is being updated?    My testing suggests that it 
cannot be
> done.
> 
> Any input would be appreciated.
> 
> 
> 
> P.S.   I realise that (if I could get this to work) the system will 
stop
> trading stocks based purely on where they sit in the alphabet.   I 
also
> believe that "A" stocks have a certain bias.   With these two 
points in
> mind, I actually use randomly assigned symbols for my stocks during 
the
> optimizing process.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get a FREE REFINANCE QUOTE - click here!
http://us.click.yahoo.com/2CXtTB/ca0FAA/i5gGAA/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/