PureBytes Links
Trading Reference Links
|
And here's a version that doesn't need a variable-period MS dll:
---8<--------------------------
{ http://www.metastocktools.com }
pr:=5; { Minimum % change }
tr:=TroughBars(1,C,pr)=0;
zz:=Zig(C,pr,%);
DwTrend:=zz<Ref(zz,-1);
DwVol:=Cum(If(DwTrend,V,0));
DwVol-ValueWhen(1,tr,DwVol)
---8<--------------------------
Beware, MetaStock's Cum() function accumulates errors with largish
numbers.
jose '-)
http://www.metastocktools.com
--- In equismetastock@xxxxxxxxxxxxxxx, "Jose Silva" <josesilva22@xxxx>
wrote:
>
> The easiest solution would be to use one of the two freely available
> variable-period MS DLLs.
>
> ---8<--------------------------
>
> { http://www.metastocktools.com }
>
> { Forum.dll from http://forum.equis.com
> or ASI.dll from http://www.thedml.com
> must be in:
> ...\MetaStock\External Function DLLs\ folder.}
>
> pr:=5; { Minimum % change }
> pk:=PeakBars(1,C,pr)=0;
> zz:=Zig(C,pr,%);
>
> DwVol:=ExtFml("Forum.VarSUM",V,BarsSince(pk)+1);
> {DwVol:=ExtFml("ASI.Sum",V,BarsSince(pk)+1);}
>
> If(zz<Ref(zz,-1) OR pk,DwVol,0)
>
> ---8<--------------------------
>
>
> jose '-)
> http://www.metastocktools.com
>
>
>
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "cc48820" <ccloos@xxxx>
wrote:
>
> I'm trying to calculate the average volume from peak to trough. The
> code below produces the error: This variable or expression must
> contain only constant data. Any ideas?
>
> Thanks, cc
>
> P1 := Peak(1, CLOSE, 5); {current peak}
> Pbars := PeakBars(1, C, 5);
> T1 := Trough(1, CLOSE, 5); {current trough}
> Tbars := TroughBars(1, C, 5);
>
> If(P1 OR T1, Sum(Volume, Abs(pbars-tbars)) / Abs(pbars-tbars)),0)
------------------------ 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/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> 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/
|