Hi,
I am Steve from Austria. I have written a small system and I want to
implement moneymanagment. The idea is:
1) set amount to risk to 1% of actual equity (if there was a losing
trade before) or 2% of actual equity (if there was a winning trade before)
2) buy amount to risk/ATR(14)*buyprice (how can I do this in
CustomBacktest?)
3) set trailing stopp to 2*ATR(14) for the first three days of trade
and from fourth day on trail with ATR(14)
All I got running in CustomBacktest was the example system which
allows to decrease percent positionsize if actuql equity is smaller
than max equity):
// small system
PositionScore = ROC(14);
Buy = C>=MA(C,60);
Sell = C<MA(C,60) OR Cross(MA(C,30),MA(C,5));
SetOption("UseCustomBacktestProc",True);
SetCustomBacktestProc("");
if( Status("action") == actionPortfolio )
{
bo = GetBacktesterObject();
bo.PreProcess();
MaxEquity = 0;
for(bar = 0; bar < BarCount; bar++ )
{
CurrentPortfolioEquity = bo.Equity;
MaxEquity = IIf(CurrentPortfolioEquity > MaxEquity,
CurrentPortfolioEquity, MaxEquity);
for( sig = bo.GetFirstSignal(bar); sig; sig = bo.GetNextSignal(bar)
)
{
sig.PosSize = IIf(CurrentPortfolioEquity>=MaxEquity,-50,-25);
}
bo.ProcessTradeSignals( bar );
}
bo.PostProcess();
I would be nice if someone could give me a little help. I have really
no idea what to do in CustomBacktest.
Thanks.
Greetings fro Austria
Steve