trying to get my Backtest report to print a column for each trade
that gives the number of open positions.
I tried the following, but it only outputs on the "Reports" page
versus on the "Results" page where I can see for every trade how
many positions are open at that time:
if( Status("action") == actionPortfolio )
{
bo = GetBacktesterObject();
bo.preprocess();
for( bar = 0; bar < BarCount ; bar++ )
{
for( sig = bo.GetFirstSignal(bar) ; sig ; sig
=bo.GetNextSignal(bar) )
{
if( sig.IsEntry() ) CurrentOpenPos = CurrentOpenPos + 1;
if( sig.IsExit() ) CurrentOpenPos = CurrentOpenPos - 1;
if( CurrentOpenPos > MaxOpenPos ) MaxOpenPos =
CurrentOpenPos;
bo.AddCustomMetric("Open Pos", CurrentOpenPos );
}
}
bo.PostProcess();
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
| Investment management software | Real estate investment software | Investment property software |
| Software support | Real estate investment analysis software | Investment software |
YAHOO! GROUPS LINKS
- Visit your group "amibroker" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
