Problem with using MACDD in aggregate series

Hi all,

I would like to count the number of stocks which fulfill the following criteria:

MACDD(12,26,1,0) < 0 AND LoopMin("MACDD(12,26,1,CTR)",14)>3 AND LoopMin("MACDD(12,26,1,CTR)",14)<8

I tried to implement this in a custom series as per attached screen capture, but it seems that it somehow doesn’t like MACDD as a rule. Rule 1 in the screen capture is not required but works fine, but somehow it must be the combination of LoopMin and MACDD.

Any solution is appreciated!


I created a custom formula out of mLMIN and it seems to work. Of course, zero companies passed that rule as written in the last five years, so…

I’m not 100% sure about this, but it is my understanding that Aggregate Series only accepts commands that are listed under the “Series Reference” tab, and LoopMin is not one of them. If I were you I would do as Paul suggests and use a custom formula for the LoopMin function. The error message seems to be incorrect in this case . . .

Thanks gents. Custom formula will work.

And here is the result (attached). It counts how many stocks in the S&P500 had a turnaround in the MACD signal between 3 and 8 bars ago with a MACDD value of -2 or smaller.

This is a custom universe that can then be used to implement the trading strategy I showed in this thread:
https://www.portfolio123.com/mvnforum/viewthread_thread,12081