Are you applying the script to the SPX directly? If not, V3 needs to use a GETDATA() for the SPX index as well. I’d also use the WithinRange() function to work out if the close is within the zone it needs to be. Here it is in isolation…
I think my code for below condition is not correct. Yes i am directly applying to nifty rather than spx.
Condition 3: If Condition 1 & 2, start a days since true count#
Condition 4: If days since true count <= ten days and the percentage of S&P 500 members crosses below 50%, signal risk-off
Condition 5: If percentage of members crosses above 66%, reset condition = true
You’ll need to provide more information, I am not sure what isn’t working based on what you’ve posted so far, and the source you have is for SPX not NIFTY, meaning there would be custom bread codes being used as well? Include all the scripts you’re using to build any custom breadth codes, and a screen shot of where your final script is showing an incorrect result.
When i applied below formula to spx it didnot match with number of signals as said in the article. Please see attached pic. Let me pose my question differently how u would have coded it for spx.