This is a preprocessed and standardized version of RSI indicator. You can replace RSI with any other indicator of your choice. Use this code as a framework for your ideas. Time Threshold parameter is useful in handling a repainting issue. By setting it to higher values you can effectively eliminate repainting! Cumulative Return, Win/Loss and Win Rate are quick & dirty performance measures helpful in tuning parameters.