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 [email protected], "Edward Pottasch" <[EMAIL PROTECTED]> 
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: [email protected] 
>   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
>


Reply via email to