home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / t / tas501.zip / DM.TAS < prev    next >
Text File  |  1993-02-25  |  1KB  |  44 lines

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