PureBytes Links
Trading Reference Links
|
Thanks Graham
Keith
Graham wrote:
> If I understand correct you want to buy when the line has been above
> the trigger line for 2 consecutive bars
> Buy = sum( (ml-sl) > 0.03, 2 ) == 2;
>
> --
> 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
> <http://e-wire.net.au/%7Eeb_kavan/ab_write.htm>
>
>
>
> On 1/31/06, Keith Osborne <kosborn3@xxxxxxxxxxxxxx> wrote:
> > Hi, the following code is taken from the standard MACD indicator which I
> > am using to understand AFL a little more. I have added a simple buy/sell
> > condition.
> >
> > What I would like to do is delay the buy decision to ensure the buy
> > signal is above the trigger level for 2 (or more) periods before the buy
> > is actioned. Could someone assist please.
> >
> > TIA.....Keith
> >
> >
> > // Simple MACD system //
> >
> > r1 = Param( "Fast avg", 12, 2, 200, 1 );
> > r2 = Param( "Slow avg", 26, 2, 200, 1 );
> > r3 = Param( "Signal avg", 9, 2, 200, 1 );
> >
> > ml = MACD(r1, r2);
> > sl = Signal(r1,r2,r3);
> >
> > Buy = (ml-sl) > 0.03;
> > Sell = Cross(sl,ml);
> > Buy = ExRem(Buy,Sell);
> > Sell = ExRem(Sell,Buy);
> >
> > Plot(0.03,"",colorBlack,styleDashed);
> > Plot( ml, StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD
> > color", colorRed ), ParamStyle("MACD style") );
> > Plot( sl, "Signal" + _PARAM_VALUES(), ParamColor("Signal color",
> > colorBlue ), ParamStyle("Signal style") );
> > Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color", colorBlack
> > ), styleNoTitle | ParamStyle("Histogram style", styleHistogram |
> > styleNoLabel, maskHistogram ) );
> >
> >
> > PlotShapes(shapeUpArrow*Buy+shapeDownArrow*Sell,
> > IIf(Buy,colorBrightGreen,colorYellow));
> >
> >
> >
> > 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
> >
> >
> >
> >
> >
> >
> >
>
>
> 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
>
>
>
>
>
> SPONSORED LINKS
> Investment management software
> <http://groups.yahoo.com/gads?t=ms&k=Investment+management+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=_XXUzbE9l5lGlZNcMu4KNQ>
> Real estate investment software
> <http://groups.yahoo.com/gads?t=ms&k=Real+estate+investment+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=5_sgDczz3ArKGMtJ9tFSJA>
> Investment property software
> <http://groups.yahoo.com/gads?t=ms&k=Investment+property+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=_N6zcwefgp4eg5n6oX5WZw>
>
> Software support
> <http://groups.yahoo.com/gads?t=ms&k=Software+support&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=MJ2jP31F3n64RDZkDadU8w>
> Real estate investment analysis software
> <http://groups.yahoo.com/gads?t=ms&k=Real+estate+investment+analysis+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=GmF8PlAJASx0wrSaX5-Zlw>
> Investment software
> <http://groups.yahoo.com/gads?t=ms&k=Investment+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=aMgGsKT4w29dMAYUzQUKzg>
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
> * Visit your group "amibroker
> <http://groups.yahoo.com/group/amibroker>" on the web.
>
> * To unsubscribe from this group, send an email to:
> amibroker-unsubscribe@xxxxxxxxxxxxxxx
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/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/
|