[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Re: Dynamic Breakout system - How to speed it up?



PureBytes Links

Trading Reference Links

Paul,

I believe we can indeed give you some answers.

A little history behind the indicator. Originally it was part of 
some work done by Thomas Stridsman for Futures Magazine...I believe 
that was in 1998. It 2004 it appeared in Traders Mag. Here is a 
summary: 
"Dynamic Breakout System" (Trading System Lab, Feb. 2003) 
Author: Thomas Stridsman 
Summary: This system enters a long (short) trade if the last closing 
price is above (below) the highest high (lowest low) of the lookback 
period. The lookback period changes based on market volatility. 

The Tradestation folks have written a very good discussion(PDF) on 
the indicator which I will upload into our files section for you. 

Years ago, before this forum and many others were around the folks 
at Equis hosted a forum that I was simply known as Metastock. A 
fellow by the name of Walter Lake introduced Stridsman's work to the 
group back in '98. There was also a bit of discussion about the use 
of +prev-prev. Turns out that it is the key to making the 
indicator "dynamic" or what we call variable in today's terminology. 
Luckily we can still go back and review some of those earlier posts 
and the site listed below will get you there.

http://www.purebytes.com/cgi-local/swish/swish-cgi.pl

Search for DBS

Metastock

1998

This will pull up all the old discussions about the system. 

Also 

http://www.purebytes.com/archives/metastock/1998/msg06413.html

>From Walter:
-----snip-------
The "+Prev-Prev" comments in the article should be researched when 
using "DBS Lookback" in other Metastock indicators.

Here's one writer's experience ... "I tested both versions on several
indices and found them to be different too:
This +PREV-PREV causes a shift to the left of the indicator, a trick 
to center an indicator?"

"after some testing, I found that without +PREV-PREV LastValue will 
deliver a constant value (the last value for LookBack in Your chart).

So in writing Tema(C,LastValue(Fml("LookBack"))) You get a TEMA with 
a constant period, as required by Metastock.

By using Tema(C,LastValue(Fml("LookBack")+PREV-PREV))
You get what You want, a TEMA with a variable period. Nice trick!"

Walter
----snip-----

Realize that back then we didn't have DLL's so our only recourse was 
to get a little creative with indicators. Today we have DLL's and it 
is for just such a purpose that they should be used.

The answer then to removing the prevs is to use a DLL.

Lnc:=Ref(HHV(H,LastValue(Fml("DBS-LookBack")+PREV-PREV)),-1); 

using the equis forum DLL available in our files, EquisForum, or 
Traders Consortium the formula would then become:

LNC:=Ref(ExtFml("ForumDLL.VarHHV",H,Fml("DBS-LookBack")),-1);

You will notice that LastValue is no longer used as well. 

That takes care of the majority of prev statements and should speed 
up your work quite a bit. If you would like I will continue to look 
at DBS-Lookback indicator and see if that prev can be removed as 
well if you like. 

After reading the Tradestation PDF entitled Dynamic Breakout II 
Strategy I think you will find that this system certainly has some 
merit although it does need some work.

Glad we could help,


Preston

  

--- In equismetastock@xxxxxxxxxxxxxxx, ppappppapp <no_reply@xxx> 
wrote:
>
> Greetings all,
> 
> A 'little bird' suggested that I should post my querry here and 
> hopefully someone might offer some advice.
> 
> O.k. here goes;
> 
> The following indicators are based on the Dynamic Breakout system 
> (DBS) as found in Thomas Stridsman's book "Trading systems that 
work"
> 
> It's simply a variation on the Turtle channel breakout method 
where 
> you buy a breakout above the highest high of `x' number of days 
ago. 
> (i.e. a HHV channel)
> This DBS system varies the channel width dynamically according to 
> price volatility (as measured by standard deviation)
> 
> The following indicator finds the VALUE of the varying channel 
width 
> (in this case the HHV channel will vary between 20 and 100 bars 
ago) 
> and is then referenced into the second indicator
> 
> ******************************
> 
> {DBS-Lookback}
> 
> {-----User Inputs-----}
> 
> VolPer:=Input("Enter StdDev periods",1,100,30);
> LBmin:=Input("Enter Min. lookback periods for entry",5,100,20);
> LBmax:=Input("Enter Max. lookback periods for entry",20,200,100);
> 
> 
> HV:= Stdev(C, VolPer);
> YestHV := Ref(HV, -1);
> DeltaHV := 1+((HV-YestHV)/HV);
> If(Cum(1)=1,LBmin,Min(Max(PREV*DeltaHV,LBmin),LBmax));
> 
> ********************************
> 
> This following second indicator then references the above first 
> indicator to plot entry and exit signals
> (i.e. not `clean' signals but ALL valid signals where they occur)
> 
> ********************************
> 
> {DBS-Lsigs}
> 
> {Dynamic Breakout system - Long signals}
> 
> { User inputs }
> Mess1:=Input("Change defaults in DBS-Lookback Indicator",0,0,0);
> 
> {Long entry & Long exit Channel}
> Lnc:=Ref(HHV(H,LastValue(Fml("DBS-LookBack")+PREV-PREV)),-1);
> 
> Lxc:=Ref(LLV(L,LastValue(Fml("DBS-LookBack")+PREV-PREV)),-1);
> 
> { Entry/Exit Long breakouts }
> entry:=H>Lnc; 
> exit:= L<Lxc; 
> 
> entry;
> -exit
> 
> *******************************
> 
> o.k., now for the question;
> 
> You will note from the above, the use of one(1) PREV command in 
the 
> first indicator and four(4) PREV commands in the second indicator 
(as 
> well as the PREV command associated with the referenced formula 
> within this indicator)
> 
> Although the indicators work fine and dandy, they take a long, 
Long, 
> L?--O--?N?--G time to plot on screen. Obviously due to the large 
> amount of computer resource demanded by the PREV command.
> If I attempt to run an exploration on numerous stocks/futures 
using 
> these indicators, I generally have to do it at night just before 
bed. 
> The results are available for me in the morning. (lucky I sleep 
for 
> 8+ hours)
> 
> Is there anything I can do to the indicator code to speed up the 
> execution?
> Or is this simply a Metastock limitation that I will have to live 
> with?
> In short how can i replace the PREV commands?
> 
> Any tips would be much appreciated.
> 
> 
> Thanks kindly,
> 
> Paul
>




 
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/