PureBytes Links
Trading Reference Links
|
What is the price when the condition is true? Just use that in buyprice =
On Thu, 14 Oct 2004 09:24:54 +1000, Beachie <beachie41@xxxxxxxxxxx> wrote:
>
> OK, thanks for that. As you can guess programming is not my forte. Next question is how do
> I extract the value for when buy1 == true?
> I thought this would work but it still returns the low
>
> Buy1 = Time AND H > ValueWhen(TimeNum()==100000,O) + 0.0020 AND Stoka > Stok;
> Buy = Buy1 ; <-- I thought this then triggered a buy as condition was met & Buy == price
> BuyPrice = Buy + 0.0004;
>
> I thought of using "ValueWhen" i.e. ValueWhen(buy1,????) but it will only allow me to use
> another array ie. H,L,O, C etc, whereas I need the actual price when condition was true.
> Sorry if it's a very simple answer, but I can't get my head around it...
> thanks
>
> ----- Original Message -----
> From: "kaveman perth" <kavemanperth@xxxxxxxxx>
>
> >
> > Buy1 is assigned a 0 or 1 according to whether all the conditions are
> > true or not
> > You have not assigned a buyprice in your statement only when buy if
> > 0/1 + 0.004, so AB then looks for the nearest price within the bar, be
> > it H or L
> >
> >
> > On Thu, 14 Oct 2004 08:22:31 +1000, Beachie <beachie41@xxxxxxxxxxx> wrote:
> >>
> >> on going from previous post, why is my Buyprice assigned the *low* of the bar even
> >> though
> >> I specify what the value should be??? I checked back throught the archives, and this
> >> all
> >> seems kosher code.......
> >>
> >> Buy1 = Time AND H > ValueWhen(TimeNum()==100000,O) + 0.0020 AND Stoka > Stok; // so
> >> here
> >> "buy1" variable is assigned price - which is definitely not the low for 99.9% of
> >> instances
> >> Buy = Buy1 ;
> >> BuyPrice = ValueWhen(Buy,Buy1) + 0.0004; //Price is always the low of the bar, not the
> >> value that caused the Buy condition to be true + spread of 0.0004
> >>
> >>
> >> Check AmiBroker web page at:
> >> http://www.amibroker.com/
> >>
> >> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> >> Yahoo! Groups Links
> >>
> >>
> >>
> >>
> >>
> >
> >
> > --
> > Cheers
> > Graham
> > http://e-wire.net.au/~eb_kavan/
> >
> >
> >
> > Check AmiBroker web page at:
> > http://www.amibroker.com/
> >
> > Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links
>
>
>
>
>
--
Cheers
Graham
http://e-wire.net.au/~eb_kavan/
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/
|