PureBytes Links
Trading Reference Links
|
To make Fred's post a little more granular...
Because of the 'array' nature of AFL, you must understand that each
statement of your AFL code is executed "only once" against the entire
array of tick data.
UNLESS... you use looping to regurgatitate or re-process individual
ticks in the array.
If this is not clear then you need to go thru TJ's basic tutorials on
the nature of array processing again.
--- In amibroker@xxxxxxxxxxxxxxx, "Fred" <ftonetti@xxxx> wrote:
>
> Start thinking in terms of your AFL getting executed ONCE and ONLY
> once. Not once per bar as in TS.
>
> Ergo for starters ...
>
> MarketPosition is undefined
> Value26 is undefined
>
> --- In amibroker@xxxxxxxxxxxxxxx, "trader3600" <trader3600@xxxx>
> wrote:
> >
> > Hi. I am new to AFL and am having trouble understanding how to code
> > the
> > following: (originally from tradestation code)
> >
> > if marketposition<>1 then value26=0; // i.e. no open positions
> > if high >= highest(high,200)and value26=0 then begin
> > value26=1;
> > value29=close;
> > end;
> >
> > if value26=1 then begin
> > exitlong at value29 * .850 stop;
> > end;
> >
> > I've been trying for hours, but the array coding is driving me
> crazy!
> >
> > any help greatly appreciated.
------------------------ Yahoo! Groups Sponsor --------------------~-->
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/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/
|