Pātuhitia tēnei: Design, testing, and optimization of trading systems