Hi,
For (1), you don't say whether the 3 bars have to be adjacent or just
any 3 out of a given lookback period, so here's 2 options to try:
DownBar = Close < Open;//Returns 1 if bar closes down
ThreeTogether = Sum(DownBar, 3) == 3;//True if 3 down bars in a row
AlertIf(ThreeTogether, "", "3 Down Bars in a row!", 0, 1);
// or try...
Whenever = Param("Lookback", 10, 3, 15, 1);
ThreeSinceWhenever = Sum(DownBar, Whenever) == 3;//True if 3 in last
x
bars
AlertIf...fill in the blanks from the code above...
For (2) I take it by "Current Price", you mean Close?. Try:
MyAverage = MA(Close, 8);//Calculate MA
HowFarBelow = Param("Points Below", 10, 2, 25, 1);
DownFarEnough = Close < (MyAverage - HowFarBelow);
AlertIf...your turn again!
You could code a parameter for the length of the MA.
For (3), Have a bash at using the LLV function to get your lowest low,
then using the help files & the 2 previous two examples you should be
able to figure it out. :-)
Cheers,
Ian
--- In [email protected], "interfool" <[EMAIL PROTECTED]> wrote:
>
> newbie question ;>)
>
> How do I code to display or alert when:
>
> 1. A minimum 3 down bars have passed
> and
> 2. current price is a good way below from the 8 MA (adjustable
param?)
> and
> 3. current price is within 1% of last previous low for the day
within
> X bars.
>
> Thanks so much. Just starting with AB.
>
> interfool
>