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

[amibroker] Re: custom backtester challenges



PureBytes Links

Trading Reference Links

Yes, i read it now and i changed my code and it WORKS!!!!!!

Thanks to GP and Tomasz. I now understand the backtester. its cool, 
its fun and its flexible. and what a eye opener that document is. My 
vote is for it to be either in the  Knowledge base  or User Knowledge 
Base website. I was hunting for something like that for all day today.
http://www.amibroker.org/userkb/category/amibroker-
features/backtester/ is actually empty.

Seede


 --- In amibroker@xxxxxxxxxxxxxxx, "gp_sydney" <gp.investment@xxx> 
wrote:
>
> Seede,
> 
> Look in the files section here for the document "AmiBroker Custom
> Backtester Interface.pdf".
> 
> Tomasz:
> Yes, that's why a position size of one with a price of 1.2 would 
give
> less than one share (or whatever is being bought).
> 
> I was also going to comment on the lack of Pre/PostProcess &
> UpdateStats, but assumed the posted snippet was not the complete
> backtest procedure.
> 
> Regards,
> GP
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "murthysuresh" <money@> wrote:
> >
> > Hello
> > Is there any example template for full low level backtester for 
AB. I 
> > would like to start with a working example and break it down to 
> > understand how the custom low level backtester works. 
> > 
> > Appreciate your help
> > 
> > Seede
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@> 
> > wrote:
> > >
> > > @gp_sydney:
> > > PositionSize in EnterTrade call is expressed in DOLLARS, not in 
> > shares.
> > > 
> > > @murthysuresh:
> > > your code does not work because you do not call 
> > PreProcess/PostProcess
> > > 
> > > See 
> > > http://www.amibroker.com/guide/a_custommetrics.html
> > > 
> > > for correct coding.
> > > 
> > > Best regards,
> > > Tomasz Janeczko
> > > amibroker.com
> > > ----- Original Message ----- 
> > > From: "gp_sydney" <gp.investment@>
> > > To: <amibroker@xxxxxxxxxxxxxxx>
> > > Sent: Saturday, September 08, 2007 1:43 AM
> > > Subject: [amibroker] Re: custom backtester challenges
> > > 
> > > 
> > > > I'm a bit confused by your EnterTrade call. You have the last
> > > > parameter set to one, which is the position size variable. If 
the
> > > > price is more than one and PosSize is only one, then that 
would 
> > only
> > > > allow a fraction of a share to be purchased.
> > > > 
> > > > Regards,
> > > > GP
> > > > 
> > > > 
> > > > --- In amibroker@xxxxxxxxxxxxxxx, "murthysuresh" <money@> 
wrote:
> > > >>
> > > >> Hello
> > > >> I am trying to force the custom backtester to trade at a 
> > predefined 
> > > >> price and predefined time. the buy signal is triggered based 
on 
> > time. 
> > > >> however backtester trades at the close price defined by the 
Buy 
> > > >> signal. there is something wrong in this code snippet that i 
> > cannot 
> > > >> figure out. 
> > > >> 
> > > >> /* Now custom-backtest procedure follows */
> > > >> if( Status("action") == actionPortfolio )
> > > >> {
> > > >> bo = GetBacktesterObject();
> > > >> 
> > > >> 
> > > >> 
> > > >> 
> > > >> 
> > > >> // try to force the enntry and exit price
> > > >> bo.EnterTrade(49360,STOCKNAME,True,1.20067,1);
> > > >> bo.exittrade(49360 +25,STOCKNAME,1.21111,1);
> > > >> 
> > > >> SumProfitPerRisk = 0;
> > > >> NumTrades = 0;
> > > >> 
> > > >> // iterate through closed trades first
> > > >> for( trade = bo.GetFirstTrade(); trade; trade = 
bo.GetNextTrade
> > () )
> > > >> {
> > > >> trade.AddCustomMetric("MAE $", StrFormat( "%.4f", 100 * 
> > trade.GetMAE
> > > >> () /
> > > >> trade.EntryPrice ) );
> > > >> trade.AddCustomMetric("MFE $", StrFormat( "%.4f", 100 * 
> > trade.GetMFE
> > > >> () /
> > > >> trade.EntryPrice ) );
> > > >> }
> > > >> bo.ListTrades();
> > > >> }
> > > >>
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 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
> > > > 
> > > > 
> > > > 
> > > > 
> > > >
> > >
> >
>




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/