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

RE: [amibroker] Looking ahead?



PureBytes Links

Trading Reference Links

Have you considered looking back?
This is a standard trick much used in TechniFilterPlus.
For example, to test entering a long position when the 10-bar average
crosses the 50-bar average, measure
the performance by considering the profit 5, 20, and 60 bars following the
cross.

This is pretty straightforward; just set up an exploration which tests
whether the signal was true 5, 20, and 60 bars ago.
I.e., 5 columns: symbol, x, fbar, tbar and sbar, where
 x=cross(MA10,MA50);  fbar = ROC(C,5)*Ref(x,-5);
 tbar = ROC(C,20)*Ref(x,-20); sbar = ROC(C,60)*Ref(x,-60);

Bob

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]On Behalf
Of dimension@xxxxxxxxxxxxx
Sent: Monday, November 28, 2005 11:12 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Looking ahead

Thanks,
I do need to use that min function I believe, but still getting some strange
behaviors with larger look ahead periods, but this time on older triggers.

For one thing, shouldn't the LookHigh formula be inverted,
        LookHigh= hhv( ref( h, period), period);

Since I want to find the high or low in a period beyond the current bar,
shouldn't I start by reference the end bar of the look ahead period, then do
an HHV or LLV from that bar?

I'll continue to looking into this...thanks much for your help.


-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of Graham
Sent: Tuesday, November 29, 2005 1:12 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Looking ahead

You can always limit the look ahead period to what bars are available

Period  = min( 10, barcount-1-barindex() );
LookHigh = ref( hhv( h, period ), period ) ;


I think this is correct maths


--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


On 11/29/05, dimension@xxxxxxxxxxxxx <dimension@xxxxxxxxxxxxx> wrote:
> This returns 0 if the look ahead number exceeds then number of bars that
> actually exists.
>
> For instance, if the trigger date is 11/20 and I use:
>        LookHigh = ref( hhv( h, 10 ), 10 ) * ( barindex() < barcount-11 );
>
> LookHigh returns 0 for the 11/20 bar.  In this case, I'd prefer if it
simply
> find the low of the existing bars following 11/20.
>
> If I just simply use:
>        LookHigh = ref( hhv( h, 10 ), 10 )
>
> It behaves a bit better, but I noticed that at some point, as I continue
to
> increase the look ahead number (i.e. make it 100), the LookHigh value
> changes.  This makes sense in most case, but in the above example,
assuming
> 11/20 as the trigger date, it should be a constant value for anything
beyond
> a look ahead number of 6, since there are only trading 6 bars following
> 11/20.  This does not happen however, it almost looks like it is looking
> back in this case.
>
> A bit confused on this, but trying to figure out why this is...
>
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf
> Of Graham
> Sent: Tuesday, November 29, 2005 12:27 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Looking ahead
>
> sorry made a mess of that, -10 instead of 10 for the ref
>
> LookHigh = ref( hhv( h, 10 ), 10 );
>
> LookHigh = ref( hhv( h, 10 ), 10 ) * ( barindex() < barcount-11 );
>
> --
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://e-wire.net.au/~eb_kavan/ab_write.htm
>
>
> On 11/29/05, Graham <kavemanperth@xxxxxxxxx> wrote:
> > I find the best to use is
> > LookHigh = ref( hhv( h, 10 ), -10 );
> > this looks at the 10th bar into the future, for the HHV of 10 bars
> > after today ( today is not included in the HHV)
> >
> > If you want to make certain that you exclude the end of the chart add
> > a condition
> > LookHigh = ref( hhv( h, 10 ), -10 ) * ( barindex() < barcount-11 );
> >
> > --
> > Cheers
> > Graham
> > AB-Write >< Professional AFL Writing Service
> > Yes, I write AFL code to your requirements
> > http://e-wire.net.au/~eb_kavan/ab_write.htm
> >
> > On 11/29/05, dimension@xxxxxxxxxxxxx <dimension@xxxxxxxxxxxxx> wrote:
> > >
> > >
> > >
> > > Hi,
> > >
> > > Given a "trigger date/bar", how can I look ahead two weeks from that
> bar/date and determine what the low was within those two weeks, providing
> there exists data in that look ahead time frame?  Is there something like
> LLV and HHV for looking ahead? (I tried using a negative number to no
> avail).
> > >
> > >
> > >
> > > thanks
> > >



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






--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/182 - Release Date: 11/24/2005


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/182 - Release Date: 11/24/2005





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







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/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/