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

[amibroker] afl array vs. loop question?



PureBytes Links

Trading Reference Links

Hi all,

I am working on a trade setup and I have it working using a For Loop
and setting each variable in the array individually.  But it seems
rather cumbersome compared to the simplicity of using the array setups
that I have looked at here on this group and in the documentation.

I have simplified this trade setup to address the problem I am having.

BarColor = IIf (Close >= Open, colorBlack, colorRed);
// Assigns color to each bar: Black if Close >= Open, Red otherwise.

Sell = Low < Lowest low of last two bars where BarColor == colorBlack;

Buy = High > Highest high of last two bars where BarColor == colorRed;

The problem I am having is that I do not know how many bars back to go
until I can get 2 bars of the same color.  It could be the previous
two bars or it could be many (I have counted as high as 20 in an
extended trending market).  

Any suggestions would be highly appreciated.

Thanks,

Marty.







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a difference. Find and fund world-changing projects at GlobalGiving.
http://us.click.yahoo.com/PcNrnD/PbOLAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

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