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