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

Re: [trading] Re: [amibroker] .....and more ???



PureBytes Links

Trading Reference Links

OK, I've tried several things but I still can't get the value of when condition was true. 
Now code just returns the H vaslue of the entry bar.

timeprice = ValueWhen(TimeNum()==100000,O) + 0.0020;
HighT = H ;
Buy2 = Cross(HighT,timeprice); // High crosses value of variable "timeprice"
Buy2a = ValueWhen( Cross(HighT,timeprice), H); // This returns value of cross???
Buy1 = buy2 AND (Stoka > Stok) AND Time ; //Buy conditions
Buy = Buy1 ; //buy conditions met
BuyPrice = ValueWhen(Buy2,Buy2a) + 0.0004; // This should return value when cross 
occurs???

thanks again
----- Original Message ----- 
From: "kaveman perth" <kavemanperth@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, October 14, 2004 9:29 AM
Subject: [trading] Re: [amibroker] .....and more ???


>
> 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/
>
>
>
> 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
>
>
>
>
>
>
>
>
> 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/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/