Re: [amibroker-afl] How to write this is the first buy signal in the past 6 bars - Thanks..That works..

Expand Messages
• Hello Graham, That additional equal to made all the difference. Thank you so much for the answer. It works great. I appreciate you taking the time to solve
Message 1 of 1 , Jul 10, 2007
• 0 Attachment
Hello Graham,

That additional equal to made all the difference. Thank you so much for the answer. It works great.
I appreciate you taking the time to solve this problem.

----- Original Message -----
From: Graham
Sent: Tuesday, July 10, 2007 8:19 PM
Subject: Re: [amibroker-afl] How to write this is the first buy signal in the past 6 bars

Here is one method

also remember that a single = means allocating a value to a variable. To check if it is equal to that value use double ==
and unless the variable is previously defined you defined you cannot reference it in a statement, eg A=A; does not work unless A was defined above it

--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://www.aflwriti ng.com

-----Original Message-----
From: amibroker-afl@ yahoogroups. com [mailto:amibroker-afl@yahoogroups. com] On Behalf Of Padhu
Sent: Tuesday, July 10, 2007 5:14 PM
To: amibroker@yahoogrou ps.com
Cc: amibroker-afl@ yahoogroups. com
Subject: [amibroker-afl] How to write this is the first buy signal in the past 6 bars

Folks,

Say i have buy = condition1;

Alert gets generated... Now few bars later again condition1 matches and another alert gets generated.

So i'd like add a filter that says Buy=condition1 and this is the first Buy in the past six bars so that buy signals don't repeat every other bar if the condition matches.

I tried something like this