PureBytes Links
Trading Reference Links
|
Terry,
Thanks for the help. I'm in need of some traing in AFL and am
willing to compensate anyone for teaching me the language. Do you
have any ideas on where I can get some training?
--- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxx> wrote:
>
> You have 2 crosses, which will likely not happen on the same day.
IF you
> assume the faster one will cross first and then this works.
>
>
>
> MA1 = MA(C,4);
>
> MA2 = MA(C,9);
>
> MA3 = MA(C,18);
>
>
>
> Buy = MA1 > MA2 AND Cross(MA1,MA3);
>
> Sell = Ref(MA1 < MA2 AND Cross(MA3,MA1),-1);
>
>
>
> //if you want to Buy on the next Day Open (after the conditions
are met)
> add this code:
>
> SetTradeDelays(1,1,1,1);
>
> BuyPrice = ShortPrice = SellPrice = CoverPrice = O; //Trade at the
Open
>
> //You can also set these in AA->Settings->Trades tab
>
>
>
> Plot(C,Name(),IIf(C > O,colorGreen,colorRed),styleBar |
styleThick);
>
> Plot(MA1,"MA1",colorLightBlue);
>
> Plot(MA2,"MA2",colorBlue);
>
> Plot(MA3,"MA3",colorDarkBlue);
>
> PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,L,-10);
>
> PlotShapes(IIf(Sell, shapeDownArrow,shapeNone),colorRed,0,H,-10);
>
> //Shapes plot on day of signal.
>
> --
>
> Terry
>
>
>
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]
On
> Behalf Of christophermuch
> Sent: Monday, April 10, 2006 14:22
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Help with Buy and Sell Signals for MA
>
>
>
> I'm trying to write an simple AFL formula that:
>
>
>
> 1)Buy on the first day that the 4-day moving average crosses the 9-
day
>
> moving average and the 18-day moving average.
>
> 2)Sell on the second day the 4-day moving average drops below the
9-
>
> day moving and the 18-day moving average.
>
>
>
> I would really appreciate the help.
>
> Christopher T. Much
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 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
>
>
>
> http://groups.yahoo.com/group/amibroker/
>
>
>
> amibroker-unsubscribe@xxxxxxxxxxxxxxx
>
>
>
> http://docs.yahoo.com/info/terms/
>
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/
|