Jerry I have this line in my code, but that doesn't make it always trade with that fixed amount, it merely sets the initial equity for the test as the name suggests. As equity rises or falls during the test, the backtester uses the current value of equity, and will keep taking trades until all the current equity is used up.
Looks like I shall have to try to learn how to do it with the custom backtester. Once again, any help with this appreciated. Regards Brenton --- In [email protected], "Jerry Laster" <[EMAIL PROTECTED]> wrote: > > Have you tried, SetOption( InitialEquity, 100000 ) at the begining of the > code? > That will not take into account any loses, but will always trade with that > fixed amount. > Jerry > > On Mon, 08 Jan 2007 23:09:39 -0500, brentonfx <[EMAIL PROTECTED]> > wrote: > > > Graham > > > > I don't actually want to size the trades based on equity at all. > > What I want to do is size the trades based on average turnover of > > the stock in question, so I take bigger trades in higher turnover > > stocks and smaller trades in lower turnover stocks. I then want to > > take as many trades as I can until I have committed an amount to the > > market equivalent to my initial equity. > > > > Even if I size trades off of initial equity, for example using a > > fixed % of initial equity risked per trade, or in other words a > > fized dollar risk per trade, the backtester will take trades until > > all the current equity is utilised. So as time progresses the > > backtester will allow more than the initial equity to be committed > > to open trades. The only way I can see to limit it is using > > MaxOpenPositons, but I don't want to limit the actual number of > > trades, just the total amount of dollars committed to trades. > > > > What I was hoping was something as simple as > > SetOption("MaxDollarsInTrades",100000); > > > > Any hints on how to do it using the custom backtester? > > > > Regards > > Brenton > > > > --- In [email protected], Graham <kavemanperth@> wrote: > >> > >> Why not just size the trades based on the initial equity rather > > than current > >> equity > >> > >> > >> -- > >> Cheers > >> Graham > >> AB-Write >< Professional AFL Writing Service > >> Yes, I write AFL code to your requirements > >> http://www.aflwriting.com > >> > >> On 09/01/07, brentonfx <brentonfx@> wrote: > >> > > >> > Tomasz > >> > > >> > Thank you for the reply, I am very very new at the custom > >> > backtester, so shall have to see if I can modify the example to > >> > suit. If anyone has actually coded the custom backtester to not > >> > compound profits, would they mind sharing how to do it? Thanks. > >> > > >> > I thought this may have been supported simply in Amibroker by > >> > setting an option somewhere that I had not managed to find. > >> > > >> > I think it is very important to be able to test without > > compounding > >> > profits for a couple of reasons. > >> > > >> > Firstly, if you do compound profits, and use position sizing > > based > >> > on your current equity, then trades that occur later in the > > backtest > >> > have a larger weighting on the overall performance of the system > >> > than those that occur earlier because they have larger position > >> > sizes. Even if position sizes are not based on current equity, > > more > >> > trades can be taken later in the backtest because more equity is > >> > available. So backtest results are always influenced more my > > trades > >> > that occur later in the test than by those that occur earlier. > > When > >> > I test I want all trades to have equal influence on the overall > >> > results regardless of when they occurred. > >> > > >> > Secondly, performance measures such as K-Ratio that are looking a > >> > straightness of the equity curve, or Sharp Ratio looking for > >> > consistency of returns, will not work correctly if profits are > >> > compounded. A compounded equity curve would ideally be > > exponential > >> > in shape, not the straight line that K-Ratio is looking for. So > > for > >> > these type of measures to work correctly it is necessary to use a > >> > fixed float value right through the test. > >> > > >> > Thirdly, in real trading, all profits can not be compounded all > > the > >> > time, as there is a requirement to pay tax on profits (unless you > >> > are luck enough to live in a tax free world!). > >> > > >> > These are just my thoughts, I would be interested to hear other > >> > peoples opinions. > >> > > >> > Regards > >> > Brenton > >> > > >> > > >> > --- In [email protected], "Tomasz Janeczko" <groups@> > >> > wrote: > >> > > > >> > > > >> > > Hello, > >> > > > >> > > Custom backtester and it is pretty easy. > >> > > This example > >> > > http://www.amibroker.com/kb/2006/03/06/re-balancing-open- > > positions/ > >> > > > >> > > can be easily modifed to achieve what you after. > >> > > > >> > > > >> > > Best regards, > >> > > Tomasz Janeczko > >> > > amibroker.com > >> > > ----- Original Message ----- > >> > > From: "Terry" <MagicTH@> > >> > > To: <[email protected]> > >> > > Sent: Monday, January 08, 2007 4:21 PM > >> > > Subject: RE: [amibroker] Not Compounding profits in backtester > >> > > > >> > > > >> > > > Custom backtest procedure can do this...not a simple project. > >> > > > -- > >> > > > Terry > >> > > > -----Original Message----- > >> > > > From: [email protected] > >> > [mailto:[EMAIL PROTECTED] On Behalf > >> > > > Of brentonfx > >> > > > Sent: Monday, January 08, 2007 05:10 > >> > > > To: [email protected] > >> > > > Subject: [amibroker] Not Compounding profits in backtester > >> > > > > >> > > > Hi > >> > > > > >> > > > I there a way to stop the backtester from compounding > > profits? > >> > > > > >> > > > I want to simulate taking out all of my profits as they are > >> > earned, > >> > > > and continuing to trade with only my initial equity, for > > example > >> > > > $100k. If I use fixed trade size of say $25k it's easy, I > > just > >> > set > >> > > > the max open positions to 4. But I want to test a system > > that > >> > uses > >> > > > variable trade sizes, and if I've taken trades of less than > > $25k > >> > then > >> > > > I want to be able to take more than 4 trades. > >> > > > > >> > > > If I don't limit the max open positions, the backtester just > >> > takes > >> > > > more and more positions at once as the test progresses and > >> > equity > >> > > > grows, so my market exposure ends up being way more than the > >> > $100k max > >> > > > that I want to limit it to at any time. > >> > > > > >> > > > Is there a way to do this? > >> > > > > >> > > > Thanks > >> > > > Brenton > >> > > > > >> > > > > >> > > > > >> > > > > >> > > > 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 > >> > > >> > > >> > > >> > > >> > > > > > > > > -- > Kind regards, > Jerry >
