Backtest Technical Analysis Strategies

Hi All,

I try to test (using Rolling Backtest function under “Screen” section) some Technical Analysis strategies, i.e. MA crossover, RSI and so on. Is it possible to test a long-short strategy? For example, can I long those whose 5-day EMA crosses above 50-day EMA and simultaneously short those whose 5-day EMA crosses below 50-day EMA?
I tried to use “Hedged Rules” under “Screen” section. However, I found the system only short SP500, but not some specific stocks.

Many Thanks!

The screener is good at prototyping concepts or for coming up with stocks for you to do your own further research on. It is not meant for asymmetrical long/short strategies. To do that you can use a couple of sims together with a ‘book’.

While Chipper’s technically ‘correct’ and his solution will work better, you can do what you want in the screener.

Just go to ‘Main Settings’ and click method long-short.

In the ‘rules’ under the long rules, put in your long rules.

i.e. Crossover(#EMA,5, 5,50)=1

In the hedge rules, under short rules, put in:

Crossunder(#EMA,5, 5,50)=1

Add your liquidity rules to each side. If you want different rankings, can create them…and then use a Rating(“Long”)>95 And Rating(“Short”)>95.

So…you can basically build tests this way. You can also use one rank…i.e. 1 Year Change and then rank ‘long-short’ on this rank.

Good luck.

Best,
Tom

Hi, thank you so much for replying me. May I ask you a further question? What do liquidity rules mean? Are they the rules set for selling my holdings? Won’t the backtesting system automatically sell current holdings after a certain period as long as I set a holding period in the backtesting tab?

The liquidity rules are for ignoring any low liquidity stocks that are to small to be able to buy sufficient # of shares to be useful in a system. Use a rule like; AvgDailyTot(60) > 200000. That will eliminate any stocks that trade less than $200K average over the last 60 days from being bought by the screen. Set the value for the lowest liquidity you are willing to buy.

Denny :sunglasses:

Liquidity rules are those rules that limit you to more liquid stocks, e.g.,

Price>5 and Vol(0)>200000

Liquidity turns into a pretty big concern on P123, because you can generally “prove” that you would have had outsized returns, had you only known to put $100,000 into that penny stock that trades $500 per day on average. (In other words, your model would have moved the market, decimating your returns.) Because we know nothing about underlying demand, you won’t get any warning that this makes no sense unless you use some form of liquidity rule.

Is it possible to use a different ranking system for the long rules and the short rules?