Didn’t say what timeframe you are using, have used 5 minute chart to get 12 bars e.g. 3 minute bars would be 20 bars. Only takes a position if third last trade was over an hour ago.
NumberOfBarsInHour = 12
TradeBar = TRADEINDEX(3)
if TradeBar = 0 or (barindex – TradeBar > NumberOfBarsInHour) then
//if some condition then
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