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

[amibroker] Incorrect rounding of shares in backtester!



PureBytes Links

Trading Reference Links

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

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