Help: Calculating ADX Versus ADX Wilder

 

I need your help, 

I'm using python to program an adx indicator processor; Sofar, I can accurately calculate the ADX-Wilder but I want to calculate the ADX instead.
The ADX-Wilder indicator is described  here: https://www.mql5.com/en/code/8 and the ADX here https://www.mql5.com/en/code/7 but I don't know the mlq5 language yet.


A snippet from my code is attached, How to I change the calculation of ADX Wilder to calculate ADX? Or how can I calculate both?

# calculate directional index by dividing by true range
pdi14 = (pd14/tr14)*100
ndi14 = (nd14/tr14)*100

# get adx by averaging diff/sum
dx_values.append(((pdi14-ndi14)/(pdi14+ndi14))*100)
adx = average(dx_values)
Reason: