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

[EquisMetaStock Group] Convert for Metastock



PureBytes Links

Trading Reference Links

You cannot reply to this message via email because you have chosen not
to disclose your email address to the group.  Please use this
page to reply.
 



Hi,


Is possible to convert this formula for Metastock ?

http://www.ensignsoftware.com/tips/tradingtips20.htm

ESPL Script:

Theoretical Wave Builder
The Ensign Software Programming Language (ESPL) was used to create the theoretical chart used in the first article.  The complete ESPL script is listed here. // Author:  Howard Arrington
// Date:    08-17-2001
// Purpose: Create a theoretical chart file
//
procedure Theory;
var 
  sPattern, s24Up, s13Up, s24Dn, s13Dn: string;
  s5WaveUp, s3WaveUp, s5WaveDn, s3WaveDn: string;
  t: TDateTime;
  c,i,j,k,n,d,count: integer;
  price: real;
begin
  s13Up:='5U3D5U';      {5 up bars, 3 down, 5 up}
  s24Up:='5U3D8U3D5U';
  s13Dn:='5D3U5D';
  s24Dn:='5D3U8D3U5D';

  s3WaveUp:=s24Up+s13Dn+s24Up;
  s5WaveUp:=s24Up+s13Dn+s24Up+s13Dn+s24Up;
  s3WaveDn:=s24Dn+s13Up+s24Dn;
  s5WaveDn:=s24Dn+s13Up+s24Dn+s13Up+s24Dn;

  sPattern:=s5WaveUp+s3WaveDn+s5WaveUp+s3WaveDn+s5WaveUp;          {Major Up}
  sPattern:=sPattern+s5WaveDn+s3WaveUp+s5WaveDn;                   {Minor Down}
  sPattern:=sPattern+s5WaveUp+s3WaveDn+s5WaveUp+s3WaveDn+s5WaveUp; {Major Up}
  sPattern:=sPattern+s5WaveDn+s3WaveUp+s5WaveDn+s3WaveUp+s5WaveDn; {Major Down}
  sPattern:=sPattern+s5WaveUp+s3WaveDn+s5WaveUp;                   {Minor Up}
  sPattern:=sPattern+s5WaveDn+s3WaveUp+s5WaveDn+s3WaveUp+s5WaveDn; {Major Down}
 
  t:=EncodeDate(1990,1,1); {January 1, 1990}
  i:=1; k:=length(sPattern); n:=0; price:=500; count:=0;
  Chart(sPath+'\Hist\Theory.D');

  while i<k do begin
    if IsNumeric(Copy(sPattern,i,1),c) then n:=n*10+c
    else begin
      if Copy(sPattern,i,1)='U' then d:=10 else d:=-10;
      for j:=1 to n do begin
        inc(count); {count bars}
        t:=t+1; if DayOfWeek(t)=7 then t:=t+2; {skip weekends}
        SetVariable(eBarCount,count);
        SetBar(eDate,count,DateToLong(t));
        SetBar(eVolume,count,count);
        SetBar(eInterest,count,count);
        if d>0 then begin                 {build Up bar}
          SetBar(eOpen,count,price+1);
          SetBar(eHigh,count,price+d);
          SetBar(eLow, count,price);
          SetBar(eLast,count,price+d-1);
        end
        else begin                        {build Down bar}
          SetBar(eOpen,count,price-1);
          SetBar(eHigh,count,price);
          SetBar(eLow, count,price+d);
          SetBar(eLast,count,price+d+1);
        end;
        price:=price+d;
      end; n:=0;   {start new quantity}
    end; inc(i);   {next character in pattern}
  end;
end;

begin
  if who=1 then Theory;
end;


    








Yahoo! Groups Sponsor


<font face=arial
size=-2>ADVERTISEMENT<img src="http://ad.doubleclick.net/ad/N879.ameritrade.yahoo/B1054521.11;sz=300x250;adc=ZHS;ord=1034384304?"; alt="" width="300" height="250"
border="0">









To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx





Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.