[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Please Help



PureBytes Links

Trading Reference Links

Brian,

it's OK, not laughing (well, I was, but only because I was rewatching
Kill Bill 1).

> NumTrades = 0;
you probably don't need this

> for( trade = bo.GetFirstTrade(); trade; trade = bo.GetNextTrade() )
you don't want to scan trades, but bars (look at the example in the
docs, you'll figure it out). At every bar you process signals at that
bar like you did here (wrong place)
> {

but first  you have to scan open position(s) to update the running
MAE/MFE in some variable, probably via varget/varset, from the second
bar on, so a loop on open positions should be here, before processing
this bar's signals

then do entry/exit for current bar
> bo.ProcessTradeSignals(BarCount);

now you can scan all closed trades up to this bar
for( trade = bo.GetFirstTrade(); trade; trade = bo.GetNextTrade() )
{

here you'll check if trade EXIT date is at this bar and if it is
you'll add the custom metric computed before for the trade's symbol

}

> NumTrades++;
no need for this either

end of backtest...
> } 

and then you list all trades executed with your custom metrics

> bo.ListTrades();
> }

here you put your buy-sell-cover-short rules

I'd suggest you to spend a couple of days or more on the doc/help,
think over it a lot (don't get offended, it took quite some time for
me also), try the examples, play with them. Break the problem in
smaller pieces like we did above, search the list for solutions to
these smaller problems and you will make it.

Go figure: I spent the last couple of months learning to code my
system, and I'm not satisfied yet... patience and willpower...

> 
> --- In amibroker@xxxxxxxxxxxxxxx, neurotic self <neuroticself@xxxx>
> wrote:
> > Hi Brian,
> >
> > there may be a simpler solution, can't think of it right now.
> >
> > This definitely can be done in low level backtesting, eg:
> track/update
> > your personalized MAE/MFE at every bar in a set of variables
> > (varset/varget, one per symbol) from the  bar after entry and
> onwards,
> > and after invoking
> > bo.ProcessTradeSignals( bar );
> > you can scan all your trades (I wish TJ could give us a more
> efficient
> > way, like scanning from last closed trade and backwards...) and
> add a
> > custom metric to those that closed during the current bar, with the
> > proper value.
> >
> > Hope it's correct, let me know if this is clear and fits you
> >
> > neuro
> >
> > On 9/4/05, coba702002 <coba702002@xxxx> wrote:
> > > I am trying to figure out a way to NOT include (h-L) activity in
> the
> > > MAE/MFE calcs,since i enter on bar close and don't want the
> entry bar
> > > (H-L) to be part of the calc. Is there a way around this in the
> low
> > > level backtester custom metrics code. I have tried sooooo many
> things
> > > and cannot get anything to work, i have pulled most of my hair
> out so
> > > before i lose it all please help :))
> > >
> > > Trade drawdown (as well as MAE and MFE) is different because it
> > > *includes* intraday activity (H-L)
> > >
> > > thanks in advance
> > > Brian
> > >
> > >
> > >
> > >
> > >
> > > 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
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Janeczko for President!
> 
> 
> 
> 
> 
> 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
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 


-- 
Janeczko for President!


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Help tsunami villages rebuild at GlobalGiving. The real work starts now.
http://us.click.yahoo.com/njNroD/KbOLAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/