In reply to this question https://www.prorealcode.com/topic/risk-and-money-management-errors/page/2/#post-178768, this is my reply. Make the last line read: Return rsi_14 AS "Rsi",70 AS "OverBought",30 AS "OverSold"