Nice indicator, i did someting similar.. but to make it more clear i suggest to draw the arrow 2 bars after the current position. That is because in this function, for example, you check the value of the rsi next to the current position (shift): ...