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

Re: [RT] GEN - code for smart money dumb money SMDM V2



PureBytes Links

Trading Reference Links

This should do it for .ela folks.
Code was created and posted because of a few private and public requests
and not that it had any great redeeming value.

Here is new source code taken from  TS4  and an  .ela  generated
in TS4 so they should work.

Clyde

{================================================================

SMDM summation

Adapted from the book "Street Smarts" by Raschke and Connors
    Smart Money Index,
    DM = dumb money Buy/Sell in first half hour,
    SM = smart money Buy/Sell in final hour,
    DMTimBeg and DMTimEnd set the dumb money period,
    SMTimBeg and SMTimEnd set the smart money period.
    Adjust input N so that first day does not distort the data.
    Coded by Bob Roeske bobrabcd@xxxxxxxxxxxxx 6/10/2001
    Fixed by Clyde Lee  clydelee@xxxxxxxxxxxx  6/13/2001
 ================================================================}

Inputs:   DMTimBeg(0630),  {Begin time -- ignored since we use day
     }
          DMTimEnd(0700),  {End time for dumb buys -- end first 1 or 1/2
    }
          SMTimBeg(1200),  {Begin time for smart buys -- begin last 1 or 1/2
hr.}
          SMTimEnd(1300),  {End time for smart buys -- should be last bar of
day}
          LenS(10),        {Length for "short term" smoothing of
        }
          LenM(50),        {Length for "medium term" smoothing of
s       }
          LenL(200);       {Length for "long term" smoothing of
        }

Vars:  DM(0),SM(0),PSM(0),SMT(0),SMDMS(0),
       SmoothS(0),SmoothM(0),SmoothL(0);
       {Compute XAverage factors for different lengths}
Vars:  AlphaS(2/(LenS+1)),AlphaM(2/(LenM+1)),AlphaL(2/(LenL+1));
Vars:  DidInit(False), HoldO(0), Kount(0);

If Date<>Date[1] then begin
  {Skip first day and increment count every day & hold open value for day}
  DidInit=True;
  HoldO=Open;
  Kount=Kount+1;
End;

If DidInit then begin
  {This bypasses the first "problem" day}
  If Time=DMTimEnd then DM = (HoldO-Close); {end dumb period-set value}
  If Time=SMTimBeg then SM=Close;     {start smart period}
  If Time=SMTimEnd then begin   {end smart period}
    PSM = Close-SM;   {smart buying}
    SMT = DM +PSM;    {sum dumb and smart}
    SMDMS = SMDMS+SMT;{continuous sum}
    If Kount=1 then begin  {take care of initialization of XAverage}
      SmoothS=SMDMS;
      SmoothM=SMDMS;
      SmoothL=SMDMS;
    End
    Else begin    {We will use XAverage equivalent so only happens once per
day}
      SmoothS = SMDMS*AlphaS+SmoothS*(1-AlphaS);
      SmoothM = SMDMS*AlphaM+SmoothM*(1-AlphaM);
      SmoothL = SMDMS*AlphaL+SmoothL*(1-AlphaL);
    End;
    PLOT1(SMDMS,"SMDMS");       {Plot raw data and all smoothings}
    Plot2(SmoothS,"SmoothS");
    Plot3(SmoothM,"SmoothM");
    Plot4(SmoothL,"SmoothL");
  End;
end;



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

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


Attachment: Description: "BR_SMDM.ELA"