help. Put it on top of your AFL, with Stat being the array you want
to determine.
function FindStatAtEndTrade (Stat, dt, Value)
{
found = -1;
for( i = 0; i < BarCount AND found==-1; i++ )
{
if( dt[ i ] == Value ) found = i;
}
result = Null;
if( found > 1 ) result = Stat[ found ];
return result;
//return IIf( found != -1, Stat[ found], Null ); // Stat at
end /close of trade
}
So in your for (trade=bo.getFirstTrade() . . .)-loop you place:
MonthAtExit= FindStatAtEndTrade( Month(), dt, trade.ExitDateTime );
etc.
PS
--- In [email protected], "rdavenportca" <[EMAIL PROTECTED]>
wrote:
>
> Thanks, that helped, but I'm not there yet. I figured out how to
> add columns using the user-defined metrics. But I can't figure out
> how to get the data I need for each symbol, which is Month() and
Year
> (). This object-oriented nominclature is stumping me. Any
> suggestions would be appreciated.
>
>
>
> --- In [email protected], Keith McCombs <kmccombs@> wrote:
> >
> > Search for 'backtest' under Help. Then select "How to add user-
> defined
> > metrics to backtest/optimization report"
> >
> > rdavenportca wrote:
> >
> > > I am new to Amibroker and this site. I'm in the process of
> trying to
> > > learn the language. It's a lot harder than TradeStation!
> > >
> > > I would like to add two columns to the backtester output:
> > >
> > > (1) the month each trade was exited
> > > (2) the year each trade was exited
> > >
> > > I think this should be possible, but I can't figure out how.
> Any help
> > > would be greatly appreciated.
> > >
> > > Regards,
> > >
> > > Rob
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > 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
> > > <http://groups.yahoo.com/gads?
>
t=ms&k=Investment+management+software&w1=Investment+management+softwa
>
re&w2=Real+estate+investment+software&w3=Investment+property+software
>
&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=I
> nvestment+software&c=6&s=200&.sig=_XXUzbE9l5lGlZNcMu4KNQ>
> > > Real estate investment software
> > > <http://groups.yahoo.com/gads?
>
t=ms&k=Real+estate+investment+software&w1=Investment+management+softw
>
are&w2=Real+estate+investment+software&w3=Investment+property+softwar
>
e&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=
> Investment+software&c=6&s=200&.sig=5_sgDczz3ArKGMtJ9tFSJA>
> > > Investment property software
> > > <http://groups.yahoo.com/gads?
>
t=ms&k=Investment+property+software&w1=Investment+management+software
>
&w2=Real+estate+investment+software&w3=Investment+property+software&w
>
4=Software+support&w5=Real+estate+investment+analysis+software&w6=Inv
> estment+software&c=6&s=200&.sig=_N6zcwefgp4eg5n6oX5WZw>
> > >
> > > Software support
> > > <http://groups.yahoo.com/gads?
>
t=ms&k=Software+support&w1=Investment+management+software&w2=Real+est
>
ate+investment+software&w3=Investment+property+software&w4=Software+s
>
upport&w5=Real+estate+investment+analysis+software&w6=Investment+soft
> ware&c=6&s=200&.sig=MJ2jP31F3n64RDZkDadU8w>
> > > Real estate investment analysis software
> > > <http://groups.yahoo.com/gads?
>
t=ms&k=Real+estate+investment+analysis+software&w1=Investment+managem
>
ent+software&w2=Real+estate+investment+software&w3=Investment+propert
>
y+software&w4=Software+support&w5=Real+estate+investment+analysis+sof
> tware&w6=Investment+software&c=6&s=200&.sig=GmF8PlAJASx0wrSaX5-Zlw>
> > > Investment software
> > > <http://groups.yahoo.com/gads?
>
t=ms&k=Investment+software&w1=Investment+management+software&w2=Real+
>
estate+investment+software&w3=Investment+property+software&w4=Softwar
>
e+support&w5=Real+estate+investment+analysis+software&w6=Investment+s
> oftware&c=6&s=200&.sig=aMgGsKT4w29dMAYUzQUKzg>
> > >
> > >
> > >
> > > ----------------------------------------------------------------
-
> -------
> > > YAHOO! GROUPS LINKS
> > >
> > > * Visit your group "amibroker
> > > <http://groups.yahoo.com/group/amibroker>" on the web.
> > >
> > > * To unsubscribe from this group, send an email to:
> > > [EMAIL PROTECTED]
> > > <mailto:[EMAIL PROTECTED]
> subject=Unsubscribe>
> > >
> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms
> of
> > > Service <http://docs.yahoo.com/info/terms/>.
> > >
> > >
> > > ----------------------------------------------------------------
-
> -------
> > >
> >
>
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.
