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