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
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok