Index | Recent Threads | Who's Online | Search

New Thread
This topic has been viewed 95 times and has 4 replies
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!

Attachment Capture.JPG (76885 bytes) (Download count: 55)

Jan 16, 2020 9:30:52 AM       
Re: Problem with using MACDD in aggregate series

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...

Jan 16, 2020 9:50:45 AM       
Edit 1 times, last edit by pdemartino at Jan 16, 2020 9:58:38 AM
Re: Problem with using MACDD in aggregate series

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 . . .

Yuval Taylor
Product Manager, Portfolio123
Any opinions or recommendations in this message are not opinions or recommendations of Portfolio123 Securities LLC.

Jan 16, 2020 1:01:16 PM       
Re: Problem with using MACDD in aggregate series

Thanks gents. Custom formula will work.

Jan 17, 2020 2:31:40 AM       
Re: Problem with using MACDD in aggregate series

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:,12081

Attachment Capture.JPG (96239 bytes) (Download count: 28)

Jan 17, 2020 6:19:59 AM