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

[amibroker] Re: Simulating adding captial and an intrest setting question



PureBytes Links

Trading Reference Links

In case any other newbies out there are interested, this can be done 
using the custom backtester ( see below code).  I am not yet sure if 
this code has any bad side effects, but running it as is produces 
the expected staircase like equity curve ( with interest set to 0)

James

SetOption("UseCustomBacktestProc", True );
SetCustomBacktestProc(""); 

Y = DayOfYear() - Ref(DayOfYear(), -1);

if( Status("action")== actionPortfolio ) 
{ 
   bo = GetBacktesterObject(); 
   bo.PreProcess(); 

   for( bar = 0; bar < BarCount; bar++ ) 
     { 
      bo.ProcessTradeSignals( bar ); 
      if ( Y[bar] < 0) 
       {  
        bo.Cash = bo.Cash + 4000;}
       
      } 
   bo.PostProcess(); 
            
} 

Buy = 0;
Sell = 0;

--- In amibroker@xxxxxxxxxxxxxxx, "jamesfarrow2003" 
<jamesfarrow2003@xxx> wrote:
>
> While I am still trying to train myself on some of the 
fundamentals of 
> trading, I am trying to just play around with the S/W to learn 
that at 
> the same time.
> 
> I am not sure if AmiBroker has this capability...What I am trying 
to 
> do right now is to code something that will simulate periodic 
addition 
> of capital.  For instance, if I wanted to create a system for an 
IRA, 
> I would like to determine the effect that adding capital each year 
> makes to the equity curve.  Another thing I could get from this is 
> after how many years does adding capital cease to have a 
significant 
> impact on the equity.  
> 
> All of the above would be useful for my own information, but I 
would 
> also like to creat some charts that I could use to train my kids 
when 
> they are a little older on the power of investing early in life.
> 
> One the interst setting topic, I have been readin a book by Van 
Tharp 
> and he indicated a prefernce of setting interest to 0 while back-
> testing.  It seems to me that if you want to realistically compare 
> your system to another result ( say buy and hold, or another 
system), 
> you would need to model the interest you believe your capital will 
> earn when not in the market.  I am curious how other people handle 
> this issue, and their reasoning behiund it.  
> 
> Thanks for any input
>



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/