#output_file 'dm.lst' #max_quotes 150 { DM.TAS Wilder's Directional Movement Trading Example This script will indicate a BUY signal if the +DI(14) crosses above -DI(14) and ADXR > 25 a SELL signal if the -DI(14) crosses above +DI(14) and ADXR > 25 } pdi_array : array; { declare the +DI (Positive Directional Movement array} mdi_array : array; { declare the -DI (Negative Directional Movement array} pdi_array := pdi(14); { calculate +DI} mdi_array := mdi(14); { calculate -DI} adxr_14 := adxr(14); adx_14 = adx(14); dx_14 = dx(14); if first_ticker then begin writeln('TICKER ADXR DX ADX +DI -DI ACTION'); end; write(ticker,' ',int(adxr_14), int(dx_14), int(adx_14), int(pdi_array[0]), int(mdi_array[0])); action = ''; if (adxr_14 > 25) then { AVG DX Rate of Change > 25 } begin if (over(pdi_array,mdi_array) = 0) then action = '** BUY SIGNAL'; else if (over(mdi_array,pdi_array) = 0) then action = '** SELL SIGNAL'; end; writeln(action);