Screener vs Strategy Backtest

Hello everyone,

I would like to understand why such differences between the results of a screener & strategy backtest (of course, with all same rules, universe, period and rebalance). I guess and would like your confirmation:

  • In screener, at each rebalance period, we sell all the stocks that does not fit all the buy criteras and buy all new ones
    In backtest, the stock in the portfolio are sell only when meet the sell criteras (for example, we could implement a NoDays>20 si simulate the 4 week rebalance of the Screener).
  • In screener, by default, the number of stocks is unlimited (“0”) while in Strategy, we bought only the “X” “best” stocks for our order.

Is that all ? I found very different results trying the do backtest with the exact same rules…
Does some use “Screener backtest” results for real trading ?

Thanks for your answers !

Everything you wrote is accurate and these differences can easily cause large differences in the results.

Also, the screener buys the same amount of each stock in each rebalance. The strategy backtest uses the available cash, so the amount bought will be different from current holdings unless you set the sell rules in the strategy to sell all stocks at each rebalance.

And there are settings available in the strategy backtest that are not available in the screener backtest. They can change the results depending how you have them set. For example: Allow Immediate Buyback, Force Positions into Universe, Allow Mergers and Load Global Restrictions.

Hello. I have not been able to replicate the screener performance in strategy backtester.
What’s the code to sell all stocks at each rebalance in the backtester?
I would like to rebalance each 1st trading day of the month. I have been using this code in strategy backtester (Monthday<=4 and Monthday<= PrevBarDaysAgo). Do you know if there is any other way to do it in the screener?
Thank you.

To sell all stocks at each rebalance in a strategy, put 1 = 1 or True as a sell rule and check the “Allow Immediate Buyback” option in the Rebalance tab.

There’s not a good way to rebalance on the first trading day of the month in a screen. A 4-week rebalance is your closest option.

Thank you. It’s a pity we can`t rebalance on the first/second or even last trading day of the month in a screen, to take advantage of calendar and day of the month anomalies. I tried to replicate my system in the strategy backtester using (Monthday<=4 and Monthday<= PrevBarDaysAgo), but as other users said, there are some important differences, that cause large differences in the results.
Anyway, at least, is it possible to use all available cash on each rebalance date, to buy equal-weighed positions, just like the screener does?
Thank you

Yes, if you follow my rules, the strategy would use all available cash on each rebalance date and will buy equal-weighted positions, just like the screener does, with one caveat. They won’t be exactly the same weight because we don’t allow fractional shares. So if you have $100,000 in cash and 20 stocks, they will each get a position as close as possible to $5,000, but if a stock costs $600 per share, you’ll get 8 shares, which is $4,800 worth instead of $5,000.

Actually this is somehow good that the results are different.
The manipulation of fractional shares yes/no options, should not affect performance of your strategy if you hold +20 stocks.
Therefore this experiment allows you to validate your strategy. If the difference is large then it is likely that you overoptimized your strategy.

Thank you for your help. I’ve also found that at rebalance date, even if I add 1 = 1 on sell rules, if the number of stocks is lower than Ideal number of positions, the backtester hold the remaining capital in cash (for example, if the ideal number of stocks is 10, and backtester just find 5 stocks, 50% is keeping in cash until next rebalance date). Is that correct? Can I change this assumption to keep full invested all the time?
Thanks again.

Yes. You could either:
a) loosen your buy rules to allow more buys;
b) raise the ideal size specified in the rebalance tab; or
c) use formula weight position sizing.

To do c), click on “Formula Weight” as your sizing method and put in “1” in the Positions Weight Formula box. Put the ideal number of stocks at 10. And click “Automatically adjust new transactions to remain at 100% invested.”