I want to find the optimal trailing stop percent on a stock or set of stocks from a given date. For example, a backtest of Pandora stock (P) starting on April 2nd 2014: If I were to buy Pandora stock on on April 2nd, what is the optimal trailing stop? I would want to test trailing stops of (1, 2, 3, 4, 5, 6, 7, 8, etc). Is there any easy way to loop through different parameters in Quantopian and arrive at the optimal value(s) for a parameter or set of parameters?
Although trailing stop is the subject here, the question can be extended to include crossovers, momentum measures, etc. For example, what is the optimal short/long crossover pair to indicate a buy signal ((10day, 20day), (10day, 30day), (50day, 200day), etc)
Thanks,
Mike