PureBytes Links
Trading Reference Links
|
David,
The attached will get you in the vacinity of what
you want - but not by the way you are trying to achieve it.
The problem in coding what you after is the
timeframe it is to happen within. Is it within 3 days, a week, 2 weeks etc
etc.
You'll probably always want to judge for yourself
when the pullback is complete and thus when it is safe to
buy. This code should select
the candidates you're after - but after that it's up to you to pull the
trigger.
/* Breakout - Afl implementation by Geoff
Mulhall 12/5/2001 */
range = 5;maShort = 10;maMedium =
20;
/* Breakout Criteria */
oneAtr = ref(atr(range),-1);
cond1 = close > ma(close,maMedium) + 0.75 *
oneAtr;
buy = cond1;
sell = close < ma(close,maShort);
buy = exrem(buy,sell);sell =
exrem(sell,buy);
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
David
To: <A title=amibroker@xxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Saturday, May 12, 2001 4:18
PM
Subject: [amibroker] Re: bow tie
oops a fix to part of the formula was ref forward days
(crystal balling)/*bow tie from Dave Landry
12.05.2001*/buymov = close >ma(close,10) Andclose >
ma(close,20) andclose > ma(close,30) ;setup = low<
Ref(low,-1);buysignal = high> ref(high,-1);Buy = setupand
buysignal and buymov ;sell = c<ma(close,20);Now how do iget it
to check the next part:if setup occours then look of buysignal on
following days not the same day ??David--- In
amibroker@xxxx, "David" <dtholz@xxxx> wrote:> Hi TJ and
others,> > I was trying to write a afl form an idea posted on
another forum > here is the start of the ami formula but I seem tobe
having trouble > with the final stage of it ...> below is a
describtion of how it should perform > i may need a few iif's to
complete the code ..> > Idea's welcome > > Regards
David > > /*bow tie from Dave Landry >
> 12.05.2001*/> > buymov = close >ma(close,10)
And> close > ma(close,20) and> close > ma(close,30)
; // close above mov's> setup = low< Ref(low,1)-1;
//correction from breakout> buysignal = high> ref(high,1)-1;//Then
we buy the next higher >
high than the day before> > Buy = buymov and setup and
buysignal;> sell = c<ma(close,20);> >
***************> > The Bow Tie is used to catch a change in
trend from down to up; the > trend is defined from using three moving
averages.> > 10-day simple moving average> >
20-Day exponential moving average> > 30-Day exponential moving
average> > The proper order for a down trend is; 30-Day ema>
20-Day ema > 10-> Day sma> > The proper order foran
up trend is; 10-Day sma > 20-Day ema > 30-Day > ema>
> The name for the set up comes from the pattern made from the moving
> averages converging and spreading out again as the trend is
changing.> > The rules for the Bow Tie are as
follows,> > 1. The moving averages must go from the correctdown
trend order to > the correct up trend order crossing together making an
appearance of > a bow tie.> > 2. We wait for a
correction e.g. a lower low than yesterdays low.> > 3. Thenwe
buy the next higher high than the day before. If you are > not filled
keep moving the order down as if trading a pullback > (The pattern
remains valid until the market trades below the 20-Day > ema).>
> 4. Place a stop at the lowest bar in the set up.Your
use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
|