I can ensure you that AmiBroker would round DOWN to 1000. You have mistakes elsewhere in your formula and/or settings, but unless you send FULL formula and settings to SUPPORT, no one would able to help you.
You may not be aware of the settings you are using specifically if you are using today or previous day equity for position sizing and what is your actual equity. Your "CurEquity" may not be actual equity but something else like initial equity causing confusion in your understanding of calculations. Again: FULL formula, SETTINGS and send them to SUPPORT Best regards, Tomasz Janeczko amibroker.com ----- Original Message ----- From: "olivier_molongo" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Sunday, November 16, 2008 9:47 PM Subject: [amibroker] Incorrect rounding of shares in backtester! > Hello, > > How can I get the number of shares that would be bought on a given > signal in low level CBT? > > I use the formula : > > NbShares=-ceil(sig.PosSize*CurEquity/100/sig.price/sig.RoundLotSize) > *sig.RoundLotSize; > > I don't get the exact number of shares bought or sold by AB. As an > exemple, with: > > CurEquity=500000-5 > PosSize=-5 > sig.Price=22.86 > sig.RoundLotSize=100 > > my formua gives NbShares=1000. The exact value is 1093 rounded to > 1000. > > The signal processed trades 1100 shares. The position value for 1100 > shares is 25113 that is above the 5% equity limit given by PosSize > (25000=5% * 500000). > > Amibroker default calculation seems incorrect. > > WHat is the formula used by AB? > > Regards, > Olivier > > > ------------------------------------ > > **** IMPORTANT **** > This group is for the discussion between users only. > This is *NOT* technical support channel. > > ********************* > TO GET TECHNICAL 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 > > >
