Still no replies. I wonder if this is possible in Amibroker.
A yes/no response or a link to an example document can also be very helpful. Thank you. 2008/11/14 İlhan Ketrez <[EMAIL PROTECTED]> > Thank you but it doesn't work that way, i.e. it doesn't give the entry CCI. > To clarify, I want to see the entry CCI values in the yellow areas of the > attached picture. > Could you please elaborate your response by providing an example? > > Thank you very much. > > On Fri, Nov 14, 2008 at 10:04 PM, Ara Kaloustian <[EMAIL PROTECTED]>wrote: > >> Entry for "CCI" should be just "CCI" - not "trade.CCI" >> >> >> ----- Original Message ----- >> *From:* İlhan Ketrez <[EMAIL PROTECTED]> >> *To:* [email protected] >> *Sent:* Friday, November 14, 2008 12:00 PM >> *Subject:* [amibroker] Adding custom metrics >> >> Dear friends, >> >> Regarding the addition of custom metrics to the backtest report, to >> simplify my question please find below a script from the AB documentation. >> Simply, I want to add, for example, CCI value, RSI value and various entry >> bar conditions instead of Initial risk or R multiple below. >> >> In other words, just like trade.score gives entry score, I want to add >> "trade.cci" as entry cci to the backtest report. >> >> Thank you in advance for your help. >> >> Best regards, >> Ilhan >> >> >> SetCustomBacktestProc(""); >> >> MaxLossPercentStop = 10; // 10% max. loss stop >> >> /* Now custom-backtest procedure follows */ >> * >> >> if >> *( Status("action") == *actionPortfolio* ) >> >> { >> >> bo = >> GetBacktesterObject(); >> >> bo.Backtest( >> 1); // run default backtest procedure >> >> SumProfitPerRisk = >> 0; >> >> NumTrades = >> 0; >> >> // iterate through closed trades first >> >> *for*( trade = bo.GetFirstTrade(); trade; trade = bo.GetNextTrade() ) >> >> { >> >> // risk is calculated as the maximum value we can loose per trade >> >> // in this example we are using max. loss stop >> >> // it means we can not lose more than (MaxLoss%) of invested amount >> >> // hence ris >> >> Risk = ( MaxLossPercentStop / >> 100 ) * trade.GetEntryValue(); >> >> RMultiple = trade.GetProfit()/Risk; >> >> trade.AddCustomMetric( >> "Initial risk $", Risk ); >> >> trade.AddCustomMetric( >> "R-Multiple", RMultiple ); >> >> trade.AddCustomMetric( >> "Trend", trend ); >> >> SumProfitPerRisk = SumProfitPerRisk + RMultiple; >> >> NumTrades++; >> >> } >> >> expectancy3 = SumProfitPerRisk / NumTrades; >> >> bo.AddCustomMetric( >> "Expectancy (per risk)", expectancy3 ); >> >> bo.ListTrades(); >> >> } >> >> >> > >
