PureBytes Links
Trading Reference Links
|
James,
You can probably keep the original formula. Just use the Ref function
to refer to a previous value. For example, I believe that your
modified formula is equivalent to Ref(PHigh, -2) of the original
formula.
Mike
--- In amibroker@xxxxxxxxxxxxxxx, James <jamesmemphis@xxx> wrote:
>
> Thanks Mike,
> I think that will work perfectly. I guess the best way to solve the
forward looking problem would be to change it to
> Phigh = ( Ref (H, -2) > Ref (H, -3) AND Ref (H, -2) > Ref (H, -1) );
> which would insure the high was established, or is there a better
way?
> Thanks for your help,
> James
>
>
>
> ----- Original Message ----
> From: Mike <sfclimbers@xxx>
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Tuesday, April 22, 2008 9:16:01 PM
> Subject: [amibroker] Re: How do I reference the last condition
>
>
> What about something like:
>
> Phigh = ( H > Ref (H, 1) AND H > Ref (H, -1) );
> PhighPrice = ValueWhen(Phigh, H, 1);
> Buy = Cross(H, PhighPrice) OR ...
>
> Note that your Phigh calculation is looking into the future. So,
> you'll need to adjust for that before taking the buy. Also, I don't
> have AmiBroker in front of me right now, so you'll have to
> validate whether the above is correct or not.
>
> Mike
> --- In amibroker@xxxxxxxxx ps.com, James <jamesmemphis@ ...> wrote:
> >
> > How do I reference only the last condition? In this case, say I
> want to buy when price crosses above the last pivot high or below
the
> last pivot low. I define pivot high as:
> > Phigh = ( H > Ref (H, 1) AND H > Ref (H, -1) );
> > I want to buy if price crosses the last occurence of this and not
> an occurence 20 bars ago that could be at a lower price. So Phigh
is
> only the last Phigh. Hope this makes sense.
> > Thanks in advance,
> > James
> >
> >
> >
> ____________ _________ _________ _________ _________ _________ _
> ____________ __
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile. Try it now.
> http://mobile. yahoo.com/ ;_ylt=Ahu06i62sR 8HDtDypao8Wcj9tA cJ
> >
>
>
>
>
>
______________________________________________________________________
______________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
------------------------------------
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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
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/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> 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/
|