PureBytes Links
Trading Reference Links
|
<FONT face=Arial color=#0000ff
size=2>Yes you can simulate 2-dimensional arrays in afl.
<SPAN
class=480414900-24112003>In some of my code <SPAN
class=480414900-24112003>I have for each bar of price arrays a short
auxiliary array (2nd dim) that contains n values unique to the particular bar.
The example below is equivalent to a 2-dimensional array with
dimensions (Barcount-1),5).
<SPAN
class=480414900-24112003>
<SPAN
class=480414900-24112003>The unique thing is to map your auxiliary
arrays at the end of the data history so that you can apply afl functions in the
usual way.
<FONT face=Arial
size=2>
<FONT
color=#000000>// The following
arrays must be user defined<FONT
color=#000000> Ta = Tb = Tc = Td = Te = Tf = <FONT
color=#ff00ff>5<FONT
color=#000000>; for<FONT
color=#000000>(b=2<FONT
color=#000000>;b<<FONT
color=#ff0000>BarCount<FONT
face=Arial>;b++) { T[<FONT
color=#ff0000>BarCount-<FONT
color=#ff00ff>1<FONT
color=#000000>] = Ta[b]; T[<FONT
color=#ff0000>BarCount-<FONT
color=#ff00ff>2<FONT
color=#000000>] = Tb[b]; T[<FONT
color=#ff0000>BarCount-<FONT
color=#ff00ff>3<FONT
color=#000000>] = Tc[b]; T[<FONT
color=#ff0000>BarCount-<FONT
color=#ff00ff>4<FONT
color=#000000>] = Td[b]; T[<FONT
color=#ff0000>BarCount-<FONT
color=#ff00ff>5<FONT
color=#000000>] = Te[b]; T[<FONT
color=#ff0000>BarCount-<FONT
color=#ff00ff>6<FONT
color=#000000>] = Tf[b]; SD[b] = <FONT
color=#0000ff>LastValue(<FONT
color=#0000ff>StDev(T,<FONT
color=#ff00ff>6<FONT
color=#000000>)); SL[b] = <FONT
color=#0000ff>LastValue(<FONT
color=#0000ff>LinRegSlope(T,<FONT
color=#ff00ff>6<FONT
color=#000000>)); Hi[b] = <FONT
color=#0000ff>LastValue(<FONT
color=#0000ff>HHV(T,<FONT
color=#ff00ff>6<FONT
color=#000000>)); Lo[b] = <FONT
color=#0000ff>LastValue(<FONT
color=#0000ff>LLV(T,<FONT
color=#ff00ff>6<FONT
color=#000000>)); } Plot<FONT
color=#000000>(SD,"SD"<FONT
color=#000000>,1<FONT
color=#000000>,1<FONT
color=#000000>|4<FONT
color=#000000>|<FONT
color=#ff0000>styleOwnScale<FONT
size=2>); <FONT
color=#0000ff>Plot(SL,<FONT
color=#ff00ff>"SD",<FONT
color=#ff00ff>2,<FONT
color=#ff00ff>1|<FONT
color=#ff00ff>4|<FONT
color=#ff0000>styleOwnScale<FONT
size=2>); <FONT
color=#0000ff>Plot(Hi,<FONT
color=#ff00ff>"SD",<FONT
color=#ff00ff>3,<FONT
color=#ff00ff>1|<FONT
color=#ff00ff>4|<FONT
color=#ff0000>styleOwnScale<FONT
size=2>); <FONT
color=#0000ff>Plot(Lo,<FONT
color=#ff00ff>"SD",<FONT
color=#ff00ff>4,<FONT
color=#ff00ff>1|<FONT
color=#ff00ff>4|<FONT
color=#ff0000>styleOwnScale<FONT
color=#000000><FONT face=Arial
size=2>); <SPAN
class=480414900-24112003><FONT face=Arial color=#0000ff
size=2>
<SPAN
class=480414900-24112003> -----Original Message-----From:
bromba [mailto:bromba@xxxxxxxxxxxx]Sent: November 23, 2003 6:01
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] array
in array -- is it suppported in AFL?
helo everybody,is it
possible for an array to be an element of another array, so that the
following code would work?function fArrayInArray()
{ local arrA, arrB,
arrC; for(i=0;i<BarCount;i++) arrA[i] =
Close[i]; for(i=0;i<BarCount;i++) arrB[i]
= High[i]; arrC[0] =
arrA; arrC[1] =
arrB; return arrC;}arrD =
fArrayInArray();best regards,BM<FONT
face=Arial size=2>Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS
to suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page:
<FONT
face=Arial
size=2>http://groups.yahoo.com/group/amiquote/messages/)<FONT
face=Arial size=2>--------------------------------------------Check group
FAQ at: <A
href=""><FONT
face=Arial
size=2>http://groups.yahoo.com/group/amibroker/files/groupfaq.html<FONT
face=Arial size=2> Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|