[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Incorrect rounding of shares in backtester!



PureBytes Links

Trading Reference Links

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" <olivier_molongo@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
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
> 
> 
> 

------------------------------------

**** 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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/