PureBytes Links
Trading Reference Links
|
I need to get the standard deviation of a custom metric that I'm computing by iterating through each trade in the BacktesterObject. The problem is that StDev takes an array.
How do I build an array within the loop to compute the StDev of after the loop completes? Here's what I'm doing:
if (Status("action") == actionPortfolio) { bo = GetBacktesterObject(); bo.Backtest(1); num_trades = 0; all_rmultiples = 0; for (trade = bo.GetFirstTrade(); trade; trade = bo.GetNextTrade()) { num_trades++; // ... getting r_multiple value here all_rmultiples[num_trades-1] = r_multiple; } rmultiple_stddev = StDev(all_rmultiples, num_trades - 1); bo.AddCustomMetric("StdDevRs", rmultiple_stddev); }
StdDevRs is always blank in the backtest report. Any advice?
__._,_.___
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
__,_._,___
|