You can use the keyword “summation” for this, let’s say you want to check how many candles during the past 25 ones have a close>open, then this number would be returned with:
1
N=summation[25](close>open)
From there, you can adapt to what you really want, replace 25 with the fixed or calculated number of candles you want to look back in time, or replace close>open with conditions for another type of candle you want…
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue