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

[amibroker] Re: Custom Backtest Software



PureBytes Links

Trading Reference Links

Ed,

Cute trick.. I understand in principle, but I need a little 
clarification on your code.  If you could answer these questions.

Are the BuyAdjusted and BuyPriceAdjusted vectors special variables 
that get used by the backtester?

Why did you set Sell to 5 instead of 1?

My exit is when today's close > 10 day moving average.  I can't see 
how placing that in the (>>> exit code here) would work since it will 
only execute during a buy? help?

You have already cleared up some mystery for me.

Thanks ed for your help
redlion (marlin)

--- In amibroker@xxxxxxxxxxxxxxx, "Edward Pottasch" <empottasch@xxx> 
wrote:
>
> hi,
> 
> you will not need the CBI for this. The trick here is to select 
your signals as you normally do. However, if the limit is not hit you 
want to exit at the same bar at the same price. The backtester will 
now only charge commission. The backtester now reserves this amount 
of money for this trade however it will not buy anything.
> 
> As an example I show a snapshot of how you can do this, Ed
> 
> 
> 
> // case where it is likely to enter a long position
> } else if (Buy[ i ] == 1 AND Low[ i ] < buyLimit[ i ]) {
> 
> >>>>> exit code here
> 
> // case where limit is not reached, creat a "VOID" trade
> } else if (Buy[ i ] == 1 AND Low[ i ] >= buyLimit[ i ]) {
>   
>   // enter and exit at the same price and time ("VOID" trade)
>   BuyAdjusted[ i ] = 1;
>   BuyPriceAdjusted[ i ] = Open[ i ];
> 
>   Sell[ i ] = 5;
>   SellPrice[ i ] = Open[ i ];
> 
> }
> 
> 
>   ----- Original Message ----- 
>   From: redliontrader 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Wednesday, July 25, 2007 12:58 AM
>   Subject: [amibroker] Custom Backtest Software
> 
> 
>   Attempting to work my way up the learning curve. I am trying to 
>   implement a system that scans through a list of stock, finds the 
10 
>   best trades for the day and then enters limit orders at 2% below 
the 
>   current day's close for those 10 trades. 
> 
>   I want to be able to backtest my system. I don't think the 
standard 
>   portfolio testing will work because my system uses limit orders 
to buy.
>   So they may fill or may not fill. I can't quite get my head 
around 
>   the backtesting object to get started. 
> 
>   Any help would be appreciated.
> 
>   RLT
>




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/