Wondering if someone here can help me out with this? I’m trying to create a rule to find stocks that are more than 1.5 standard deviations its mean to the index over the last 20 days. The screen below is how it’s designed in a filter in StockFetcher. I’m looking for any stocks where ZSCORE20 > 1.5. Can this same calculation be done in a rule in P123?
/FIRST DETERMINE HISTORICAL RATIO OF S&P STOCK TO THE SPY OVER THE LAST 20 DAYS/
SET{PRICERATIO, CLOSE / IND(^SPX,CLOSE)}
SET{RATIOMA20, CMA(PRICERATIO,20)} /* CMA is custom moving average */
SET{RATIOSTD20, CSTDDEV(PRICERATIO,20)} /*CSTDDEV is custom standard deviation */
SET{DIFF20, PRICERATIO - RATIOMA20}
SET{ZSCORE20, DIFF20 / RATIOSTD20}
Obrigado!
Tony