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

[amibroker] Backtester does not use cumulative profits for position sizing



PureBytes Links

Trading Reference Links

Hello,

I am testing a fixed risk strategy (from Howard Bandy 1st book, figure 
22.20) but I can see that the number of shares is not calculated with 
the total equity (initial + cumulative profits), instead the backtester 
calculates the maximun number of shares for the initial capital and the 
specified risk .

Why this? Is there a problem with e=equity()? I am using amibroker 5.20 
in windows XP. Maybe there is an option somewhere or something that I 
am missing.

Thanks
Oscar

//TestingRiskPerTrade.afl
SetOption("InitialEquity",50000);
RiskPerTrade = 0.02;	//2%
RiskInPoints = 2.0 * ATR(20);
e = Equity();
Shares = RiskPerTrade * e / RiskInPoints;
SetPositionSize(shares,spsShares);
Buy = Cross(MA(C,8),MA(C,7));
Sell = Cross(MA(C,7),MA(C,8));
Plot(e,"eq",colorBlue,styleLine|styleOwnScale);



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

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