home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / busi / tas2091.zip / DM.TAS < prev    next >
Text File  |  1991-02-18  |  1KB  |  42 lines

  1. #output_file 'dm.lst'
  2. #max_quotes 150
  3. { DM.TAS
  4.    Wilder's Directional Movement Trading Example
  5.    This script will indicate
  6.       a BUY signal
  7.          if the +DI(14) crosses above -DI(14) and ADXR > 25
  8.       a SELL signal
  9.          if the -DI(14) crosses above +DI(14) and ADXR > 25
  10. }
  11. pdi_array : array;   { declare the +DI (Positive Directional Movement array}
  12. mdi_array : array;   { declare the -DI (Negative Directional Movement array}
  13.  
  14. pdi_array := pdi(14);   { calculate +DI}
  15. mdi_array := mdi(14);   { calculate -DI}
  16. adxr_14 := adxr(14);
  17. adx_14  = adx(14);
  18. dx_14   = dx(14);
  19. if first_ticker then 
  20. begin
  21.     writeln('TICKER     ADXR   DX  ADX  +DI  -DI     ACTION');
  22. end;
  23.  
  24. write(ticker,'  ',int(adxr_14),
  25.                   int(dx_14),
  26.                   int(adx_14),
  27.           int(pdi_array[0]),
  28.                   int(mdi_array[0]));
  29. action = '';
  30.  
  31. if (adxr_14 > 25)   then        { AVG DX Rate of Change > 25 }
  32. begin
  33.  
  34.    if (over(pdi_array,mdi_array) = 0) then
  35.       action = '** BUY SIGNAL';
  36.    else
  37.    if (over(mdi_array,pdi_array) = 0) then
  38.       action = '** SELL SIGNAL';
  39. end;
  40. writeln(action);
  41.  
  42.