Thank you very much!
The problem was that I was trying to use ARRAY as return type, and I was getting an error, as the correct return type was INTEGER ARRAY as you stated.
I couldn't find that in the documentation, and the field does not have a help page (as the adjacent fielt VOLATILITY has)
When I searched the postgresql docs, I found INTEGER[], which in fact is an INTEGER ARRAY, but it was a bit confusing for me, as up to now I had only used literals (words) for the return type, and not a combination of words or language specific expresions.