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

Re: Demark Sequential - a good study....one more time



PureBytes Links

Trading Reference Links

{Indicator}

Inputs: su.nBars(4),su.Count(9),su.Equal(False),su.Price(Close), 
UseRevCount(True) ;

Value1 = 
_IXTDC.SEQ.Setup(su.nBars,su.Count,su.Equal,su.Price,su.nBars,su.Count,su.Equal,su.Price,UseRevCount) 
;

If Value1 <= -1*su.Count Then Value2 = -1
Else If Value1 >= su.Count then Value2 = 1
         Else Value2= 0;


Plot1(Value2,"TDC.SEQ2");

{Function}
{
Type : User Function
Name : TDC.SEQ.SetUp
Notes: DeMark Market Studies, Sequential SetUp
        Tom DeMark's Sequential Trading System.
Index Options Group, Inc.
Mark A. Simms
Modified from original TS4 version
1) added options for short and long
2) added option for Reversal Recount


}

Inputs: su.nBarsBuy(NumericSimple), su.CountBuy(NumericSimple), 
su.EqualBuy(TrueFalseSimple), su.PriceBuy(NumericSeries);
Inputs: su.nBarsSell(NumericSimple), su.CountSell(NumericSimple), 
su.EqualSell(TrueFalseSimple), su.PriceSell(NumericSeries);
Inputs: su.RecountRev(TruefalseSimple);

Vars  : su.DnBar  (FALSE), su.UpBar  (FALSE) ;
Vars  : dn.Setup  (FALSE),        up.Setup  (FALSE),
         dn04Cnt      ( 0),        up04Cnt      ( 0) ;
Vars  : Return (0) ;

{ **** Initiation **** }


{ **** Setup - Cycle or Recycle **** }

if su.EqualBuy then
   su.DnBar  =  su.PriceBuy  <= su.PriceBuy [su.nBarsBuy]
else
   su.DnBar  =  su.PriceBuy  <  su.PriceBuy [su.nBarsBuy] ;
if su.EqualSell then
   su.UpBar  =  su.PriceSell  >= su.PriceSell [su.nBarsBuy]
else
   su.UpBar  =  su.PriceBuy   > su.PriceBuy [su.nBarsBuy] ;

{ **** SetUp - Looking for a Nine **** }
{Determine which logic to apply to continue or restart the count}
if su.RecountRev=True then Condition1 = su.DnBar and (dn04Cnt > 0 or 
(dn04Cnt = 0 and su.UpBar[1]))
else Condition1 = su.DnBar and su.DnBar[1];

if Condition1
then begin
   dn04Cnt = dn04Cnt + 1 ;

   if dn04Cnt = su.CountBuy then begin
     dn.SetUp =   TRUE ;         up.SetUp =  FALSE ;
   end ;
end
else dn04Cnt =      0 ;

{Determine which logic to apply to continue or restart the count}
if su.RecountRev=True then Condition1 = su.UpBar and (up04Cnt > 0 or 
(up04Cnt = 0 and su.DnBar[1]))
Else Condition1 = su.UpBar and su.UpBar[1];

if Condition1
then begin
   up04Cnt = up04Cnt + 1 ;

   if up04Cnt = su.CountBuy then begin
     dn.SetUp =  FALSE ;         up.SetUp =   TRUE ;
   end ;
end
else up04Cnt =      0 ;

Return = 0 ;
if dn04Cnt > 0 then Return = dn04Cnt  * -1 ;
if up04Cnt > 0 then Return = up04Cnt  * 1 ;


_IXTDC.SEQ.SetUp = Return ;





>How about pasting the text source into an email and posting it to the
>list? Few of us have any interest in pasting unknown ELAs into TS but
>maybe we can spot something in the source code.
>
>--
>   Dennis

Here it is in TS2000I format


Robert