PureBytes Links
Trading Reference Links
|
Maurizio,
Thanks for sharing your code!
Landry's BowTie was first published in Active Trader Magazine in November of 2000. Knapp wrote an article in the same magazine in February 2008 which included ideas for some more filtering.
I don't have either article so I am at a disadvantage in trying to evaluate what either author was trying to accomplish.
That being said keep in mind that no one that I know of has presenting any coding for the BowTie. There have been a number of variations on the theme though including the TSI that we have recently been discussing here and Daryl Guppy's work.
The code that you presented uses the Alert and Cross functions. I am really not comfortable that Landry's intent was to use either of these since he describes an uptrend as 10SMA>20EMA>30EMA at the site you have mentioned. Keep in mind that there is also a delay in signals by using these functions as well as some signals that are missed altogether due to the 3 day window that the alert function has.
I also came across some more ideas that Chuck LeBeau had on the subject at:
http://www.traderslog.com/Moving-Average-Crossovers.htm
One final thought is to plot the indicator on a chart along with the moving averages and visually inspect it to see how you like the buy/sell signals it generates. The ultimate would be to see how the indicator performed over a very long period of time...say from 1980 until 2009.
Hope this helps,
Preston
--- In equismetastock@xxxxxxxxxxxxxxx, maurizio_innamorati <no_reply@xxx> wrote:
>
> The well known BowTie setup introduces by David Landry in discussed in http://www.tradingmarkets.com/.site/stocks/education/chrtpats/08092000-7762.cfm (TradingMarkets) where the setup is described as follows:
> Using a 10-period simple, 20-period exponential and a 30-period exponential moving average:
> - The moving averages should converge and spread out again giving the appearance of a bow tie. At this juncture, the moving averages should be in proper uptrend order, that is, the 10-SMA > 20-EMA > 30-EMA.
> - The market must make a low less than the prior day's low.
> - Place a buy order above the high of bar described in (2.).
> - If not filled, continue to work a buy order above the prior day's high until either filled or the low trades below the 20-EMA.
> - Once filled, place an initial protective stop below low of (2).
> - Trail your stops until stopped out and/or exit in two to six days.
>
> I have tried to translate the above in Metastock code as follows (the time stop is handled in "System Editor", "Stops", "Inactivity Minimum Change"):
>
> Buy0:=
> Alert(Cross(Mov(C,10,S),Mov(C,20,E)),3) AND Alert(Cross(Mov(C,20,E),Mov(C,30,E)),3) AND Alert(Cross(Mov(C,10,S),Mov(C,30,E)),3);
> Sell0:=
> Alert(Cross(Mov(C,30,E),Mov(C,10,S)),3) AND Alert(Cross(Mov(C,30,E),Mov(C,20,E)),3) AND Alert(Cross(Mov(C,20,E),Mov(C,10,S)),3);
> I0:=Cum(Buy0 + Sell0 > -1) = 1;
> Tr0:=If(BarsSince(Buy0 OR I0) < BarsSince(Sell0 OR I0),1,-1);
> Buy1:= tr0=1 and L<ref(l,-1) and L>mov(c,20,e);
> Sell1:= tr0=-1 and H>ref(h,-1) and L<mov(c,20,e);
> I1:=Cum(Buy1 + Sell1 > -1) = 1;
> Tr1:=If(BarsSince(Buy1 OR I1) < BarsSince(Sell1 OR I1),1,-1);
> LE:= Tr0=1 and Tr1=1 AND
> Mov(C,10,S)>Mov(C,20,E) AND
> Mov(C,20,E)>Mov(C,30,E);
> SE:= Tr0=-1 and Tr1=-1 AND
> Mov(C,10,S)<Mov(C,20,E) AND
> Mov(C,20,E)<Mov(C,30,E);
> LX:= Cross(Ref(LLV(L,2),1),l);
> SX:= Cross(h,Ref(HHV(H,2),-1));
>
> Appropriate stop orders have been entered.
> Any views and comments on the above code would be much appreciated.
> Thanks.
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/equismetastock/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:equismetastock-digest@xxxxxxxxxxxxxxx
mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|