market breadth issues

hi there, i’ve created a custom breadth measure that calculates the percentage of nasdaq 100 (ndy) constituents that are exceeding a respective moving average (20ma in this example).

i’ve attached the script and a screenshot of the results.

please advise what i’m doing incorrectly. i’ve restarted optuma, downloaded history, as well as updated breadth.

any help appreciated.

market-breadth-issues.pdf (97.2 KB)

Hi,

The problem is with the script using Last().

That function will use the last closing price of the chart for all dates covered. Here is an example of the same script on a Show View, see how the blue line for Last() is horizontal.

Ex4

To achieve the result you are after you need to change Last() to Close()

Ex5

M1 = MA(BARS=20, STYLE=Simple, CALC=Close) ;
CLOSE() > M1

Once this is done the breadth code returns the expected results.

Ex6

Hi Matthew,

Thanks for the response… still having the same issue however. any advice?

breadth

Hi Matthew,

Thanks for the response… still having the same issue however. any advice?

breadth

Hi,

Had you already opened the chart before changing the script and rebuilding? If so it is possible the data was in memory and cached, so the new data could not be written. Try using the new script with a new code (no existing cache) and see how you go. If the issue remains please contact [email protected] for assistance.