Chris,
I don't see what you may be doing wrong.
Maybe someone else can see it.
Those settings work for me in my own
code, but I'm using Daily timeframe (which shouldn't matter).
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Chris Graham
Sent: Sunday, April 30, 2006 12:39
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Position
Size Settings
Thanks for
your reply Terry,
I have
BuyPrice = SellPrice = O;
I added SetOption("UsePrevBarEquityForPosSizing",False); to the
code and it made no difference.
In the Backtester settings window I have:
Initial equity 100000 – allow
position size shrinking
Positions long
Periodicity weekly
Min shares .1
Min pos value 5000
Round lot size 5
Margin requirement 100
Trades set to open with 1 bar delay
All stops disabled
And in the portfolio level settings max
open positions 10
No other boxes are checked
I run the back test on an ASX watchlist and
the first line of the AA results indicate:
Ticker
trade
date
price
exdate
shares
position
value
CXP.AX
long
1/6/01
9.66
8/6/01
1,230
11,882.85
Am I misreading something?
From:
amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Terry
Sent: Monday, 1 May 2006 3:59 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Position
Size Settings
That should work. I am doing essentially the same and it works for me.
I don't see where you are setting BuyPrices, but I don't think this
affects the results.
OC = ParamField("Trade price", field = 0 );
BuyPrice = SellPrice = ShortPrice = CoverPrice = OC
Also you are not setting this and maybe that is the problem:
SetOption("UsePrevBarEquityForPosSizing",False);
--
Terry
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of q03237241
Sent: Sunday, April 30, 2006 03:02
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Position Size Settings
Hi,
This should be simple but I am obviously missing something...
I want to limit position size in a portfolio backtest and have the
following code:
//-------------------------------------
SetFormulaName("LastWeek");
//name in backtest report
SetBarsRequired(4000,1);
//needed line
SetTradeDelays(1, 1, 1,
1);
//open & close trades delay
SetOption( "initialequity", 100000
); //initial capital
PositionSize =
10000;
//trade size
RoundLotSize = 10;
SetOption( "MaxOpenPositions", 10
); //max trades open
SetOption( "PriceBoundChecking", 1
); //trade within days bar
//--------------------------------------
However when I run the backtest the AA results show trades entered
that exceed $10,000 in value.
What am I missing here?
regards
Chris
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 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 other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
YAHOO! GROUPS LINKS