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

[amibroker] Re: Need coding help



PureBytes Links

Trading Reference Links

Graham,

Thanks...


Thomas


--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanag@xxxx> wrote:
> Try
> 
> Buy = BarsSince(cond1)<5 AND cond2;
> 
> Cheers,
> Graham
>  
> 
> -----Original Message-----
> From: tchan95014 <tchan95014@xxxx> [mailto:tchan95014@x...] 
> Sent: Thursday, 20 February 2003 7:34 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Need coding help
> 
> Steve,
> 
> Thanks for offering help, but flip() needs 2 arrays, so cond1 
against 
> cond2?
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Steve Davis" <sdavis@xxxx> wrote:
> > Use the Flip() function to keep cond1 enabled.
> > 
> > -----Original Message-----
> > From: tchan95014 <tchan95014@xxxx> [mailto:tchan95014@x...]
> > Sent: Wednesday, February 19, 2003 6:16 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Need coding help
> > 
> > 
> > Hello,
> > 
> > 	I am trying to code the following conditions into AFL, but
> > have difficulties doing it,
> > 	please advise. Thanks.
> > 
> > 	cond1 = xxx;	// a condition can come and go.
> > 	cond2 = yyy;
> > 	buy = cond1 AND cond2;
> > 
> > 	What I want is when cond1 triggers, I want to disregard its
> > status and track only cond2.
> > 
> > 	For example,
> > 
> > 	SetTradeDelays(0, 0, 0, 0);
> > 	cond1 = ref(cmo() > 80, -1);
> > 	cond2 = h > ref(h, -1);
> > 	buy = cond1 and cond2;
> > 
> > 	when cond1 is triggered, I want to buy this stock only when
> > cond2 becomes true, which might take
> > 	a couple of days (Of course they can come at the same day).
> > During these confirming days the cmo()
> > 	might come down to less than 80, but I do not care, as long
> > as cond1 has been triggered I want cond2
> > 	to take over and disregard cond1 all together.
> > 
> > 
> > 	Thanks for any ideas.
> > 
> > 
> > 	Thomas
> > 
> > 
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > 
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > 
> > Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/
> 
> 
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> 
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/


Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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