Strategy Quant Checks


I recently relistened to a Andreas Clenow presentation. One of the things he discusses to see whether a strategy has merit is to compare the strategy results to randomly selected stocks in the universe using a random number generator. Funny thing happens is that most of the random samples actually outperform the S&P500 over a full cycle and some of the strategies tested (question of robustness then arises).

  • Can we add a random number generator to the backtests to see this happen?
  • In the rebal of the backtest can we add a stop loss or an exit based on a condition e.g. close < ma(200)
  • Only rebal a stock if its no longer e.g. in the top 50 rank (even though we are selecting the top 20 stocks). This apparently improves return / reduce risk.




Hi Mandeep,

This is what the MonteCarlo Simulation is doing. It randomly selects stocks in the same universe and also randomly selects the date range. What it maintains is the hold time so that the exposure to the market is unchanged.

You need to think of the reverse of this in the filter. When we rebal, we first find securities which match the “Filter” script then we order them by the “Ranking” script. So in this case if you want a stop of close < ma(200) we just make the filter “close > ma(200)”

Note: Make sure you use a Filter Script (greater than, less than etc) and not a Signal Script (CrossesAbove etc). A Signal script is a discrete event while a Filter script is a condition which remains true for a long time.

This one is a bit harder. Until we have Survivorship Bias for the top 50 I can not see how this would work.

Hope that helps


Thanks for your reply Mathew. I see your point re the monte carlo - that’s a great point.

In regards to the second point what about adding a simple % stop loss? As an example if we rank on a 12m ROC momentum and define a entry condition as close()>ma(200) - quite often momentum can crash especially if its rebalanced on a quarterly/monthly basis. During this period it may well close significantly below its 200d ma. Would be great to see if we improve risk adjusted return with a simple 10%-15% stop loss.



Do you mean to drop the equity between rebalances? eg if we Rebalance Dec 1 and then on Dec 14 the stock plummets 15% we kick it out then rather than waiting until Jan 1 to rebalance?

Answer is “no” to that, but it is something we can look at add.

Hi Mathew - yes exactly what I mean.

If the stock drops x% or closes below its 200d ma on the 14th Dec we kick it out and goto cash. We dont wait until the next rebal period.