Scanning ADX(DMPlus) - ADX(DMMinus)


Thanks for helping out those of us who are still trying to get up to speed on scripting.

I’m trying to create a scan of a list that subtracts the number of stocks ending the day with a DMMinus from the number of stocks with a DMPlus. Simply, the scan counts the number of stocks with a DM+ for the day and subtracts the number with a DM- and returns the net amount.

I’ve used the following two formulas, neither of which has worked in the scan:

a1=ADX(BARS=14, ADXBARS=14);

a1.DMPlus - a1.DMMinus



Any help would be greatly appreciated.

Thanks - Paul

Hi Paul,

When building a script to be used with scanning you need to make sure the output result is a Boolean (True / False) value.

When you say you are after stocks ending the day with a DM Minus or DM Plus, do you mean where the ADX DM Plus line is higher than the DM Minis (and vice versa?)

If so you could use the following script:

//Set ADX
V1 = ADX();
//Find where DM Plus is higher than DM Minus
V1.DMPlus > V1.DMMinus

You can then reverse the last line to find the other setup.

Matthew - thank you very much. I really appreciate the help - Paul