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

Re: [amibroker] afl array vs. loop question?



PureBytes Links

Trading Reference Links

you can use Valuewhen to refer to some past condition and retrive the
value of a array there.

On 9/6/05, m_visto <mvisto@xxxxxxxxx> wrote:
> 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.
> 
> 
> 
> 
> 
> 
> 
> 
> 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
> 
> 
> 
> 
> 
> 
> 
> 


-- 
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


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