Write a SQL query using window functions to rank trades or signals within each instrument by time and compute a rolling performance metric.