Ok, but why are you not doing this in the EXITRUN?

Ta-lib functions need a special handling due to the reversed order of time series. That's why they cannot be arbitrarily called.