PureBytes Links
Trading Reference Links
|
Hi Paul
Here's a quick translation of the second formula. I've removed one Fml() call by creating the "LB" variable and used that in the "Lnc" and "Lxc" definitions. You'll need the Forum DLL (available in the Files section) before you can run this formula. It runs several times faster but the 1 remaining PREV in the first formula is still be a limiting factor.
I've used the ValueWhen() and IsDefined() functions in the "entry" and "exit" definitions to inhibit any plot until 1 bar after the lookback variable is valid. This prevents earlier but unwanted plots allowed by the Forum DLL not returning any N/A bars.
Hope this helps. I'll check out the other formula later today if I have time. BTW, I've only tested this formula visually on one chart so it might not produce identical results all the time. Do your own checks.
Regards
Roy
{DBS-Lsigs}
{Dynamic Breakout system - Long signals}
{ User inputs }
Mess1:=Input("Change defaults in DBS-Lookback Indicator",0,0,0);
LB:=Fml("DBS-LookBack");
{Long entry & Long exit Channel}
Lnc:=Ref(ExtFml("Forum.HHV",H,LB),-1);
Lxc:=Ref(ExtFml("Forum.LLV",L,LB),-1);
{ Entry/Exit Long breakouts }
entry:=ValueWhen(1,IsDefined(Ref(LB,-1)),H>Lnc);
exit:= ValueWhen(1,IsDefined(Ref(LB,-1)),L<Lxc);
entry;
-exit;
----- Original Message -----
From: ppappppapp
To: equismetastock@xxxxxxxxxxxxxxx
Sent: Wednesday, November 07, 2007 10:43 AM
Subject: [EquisMetaStock Group] Dynamic Breakout system - How to speed it up?
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
__________ NOD32 2642 (20071106) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
[Non-text portions of this message have been removed]
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/
|