Reply To: CountMatch() vs BarsTrue()

Optuma Forums Optuma Scripting CountMatch() vs BarsTrue() Reply To: CountMatch() vs BarsTrue()

#62393
DarrenDarren
  • Topics: 63
  • Replies: 555
  • Posts: 618

Hi Andrew,

For timecounts use the TIMESINCESIGNAL function (click here for examples). In your case you want to count how long it has been since your condition (RSI > 50) was false. Or – to frame it another way – how long has it been since RSI was below 50? This opposite condition is what you want to use:

In this example of the Dow 30 stocks, $WBA has had an RSI above 50 the longest at 25 days, with $KO, $IBM, and $HON crossing yesterday. Obviously, those with 0 are currently below 50. Workbook attached (green areas show where RSI>50).

Capture

Attachments:

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close