var *DX20 = series(DX(20));

if(CrossOver(DX20,0.0)) ... // +DI crossed -DI

if(CrossUnder(DX20,0.0)) ... // -DI crossed +DI

Hope this helps.