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

[amibroker] Re: Sequential bars code



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, "interfool" <02@xxx> 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
>



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

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