Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Entry Signals

Looking for tried and tested methods for entry signals. This is for a daily/closing equity long/short algo. Am currently using only RSI as an entry trigger, however looking for other methods which may work better?

Can you provide some examples that have worked well in the past?

Thanks for the help!

18 responses

Hi Adam,

Would you be willing to post your algorithm here? This would help clarify what you mean by "a daily/closing equity long/short algo." If not, perhaps you could flesh-out your approach.

Grant

@Grant So basically taking a basket of stocks and calculating RSI values to determine overbought vs oversold...which i guess is the main purpose of this post. Relying simply on RSI does not give me total confidence in identifying OB vs OS. I was hoping the community, thru best practices, would be able to provide insight on other techniques..maybe in lieu of/or combination with RSI. Any ideas?

Adam,

I probably don't have much valuable to add, but you might try sticking with RSI, but rather than treating each stock in your basket in isolation, instead apply a statistical normalization that takes into account the entire basket or market effect. My sense is that if you just compute an indicator without an appropriate reference, it won't work.

Grant

Thanks Grant. I had a similar thread regarding overbought vs oversold and @Anony mentioned (below). Could you possible create sample code of this approach?

" Maybe think of another approach using RSI: • Imagine taking 10 fairly correlated securities as a basket.

• Measure each's RSI and average them.

• Find the standard deviation of these RSIs and now calculate the ZScore of each as compared to the group average.

• Now you have a metric you can examine that should tell you when any one of the securities is over bought, as compared to the group, or when any one is over sold, again, comparing it to the group.

• So, when any combination of opposite ZScore'd securities surpasses some threshold, sell the over bought security, and buy the over sold one.

• When each pair has made your 5% or lost your allowable risk of 2%, close that trade.

• Keep a rolling set of trades so that you know what to close when.

This way you don't care when RSI is over bought or over sold. You only care that RSI does get over bought and over sold, sometimes, at different times.

Yeah, I saw Anony's reply...glad you picked up on it. Why don't you give it a go and post your effort here? If you get stuck, folks can assist.

Which part do you not know how to do? Keeping a rolling set of trades would be new to me...I'd be interested in seeing an example.

Gotta run,

Grant

Changing gears slightly, had a general question wrt backtesting. If i create a basket of stocks based on top percentile of market cap (as of today), and backtest for past 5 years...that would constitute "look forward bias" ...correct? because in 2008 i would not have known, and that list may/may not be different back then?

@Adam: The set_universe's are recalculated every 3 months on the last trading day of the quarter. If you are testing a set_universe today, this basket of stocks is likely not the same as it was say 5 years ago. When you backtest, for example, the 98-100% universe over 5 years, this basket changes and could be a slightly different bundle each quarter of the backtest as companies emerge or drop out, preventing a look-ahead bias. It does not backtest your specific bundle over the last 5 years - that would indeed constitute a bias.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

@Anony Interesting approach to RSI...will try and model this and see how it performs! Once again, thanks for the input!

@Alisa That sounds good..exactly what i was wanting to know...thanks!

Search around for papers on the Combine Signal Approach (CSA), it might be of interest, since it sounds like RSI alone is not satisfying.
Typically you'd want to find indicators that were not so much alike that they gave the same signals always, you might have a CSA that has a few different buy and sell switches.

Try finding indicators from different groups, something like RSI for oversold/overbought, another for volume analysis, another for momentum etc.

Anyways, just a thought

@anony Other than RSI /OBOS indicators, could you suggest other entry methods to try? Or something in conjunction with RSI?

@grant could you possibly set up an example algo with this previously mentioned approach for anony

" Maybe think of another approach using RSI: • Imagine taking 10 fairly correlated securities as a basket.

• Measure each's RSI and average them.

• Find the standard deviation of these RSIs and now calculate the ZScore of each as compared to the group average.

• Now you have a metric you can examine that should tell you when any one of the securities is over bought, as compared to the group, or when any one is over sold, again, comparing it to the group.

• So, when any combination of opposite ZScore'd securities surpasses some threshold, sell the over bought security, and buy the over sold one.

• When each pair has made your 5% or lost your allowable risk of 2%, close that trade.

• Keep a rolling set of trades so that you know what to close when.

This way you don't care when RSI is over bought or over sold. You only care that RSI does get over bought and over sold, sometimes, at different times.

@Adam,

I would give the coding a try yourself first...and if you run into trouble, just ask for help. Seems like Anony has provided a decent outline, so just jump in and start coding!

Grant

@anony thanks for the example! were the stocks selected arbitrarily for this example algo? Or are they "fairly correlated" as you described above for this method?

@grant any idea why PandL would show continuous positive and algo returns negative?

@anony reason asking is because if i wanted to use say a basket of the top 50 from the sp500 based on market cap...it may be they are not fairly correlated. In this case would i still be able to employ this method? Or would there be an alternative approach for uncorrelated stocks? thanks!

Hi Adam,

I don't have the time to dig into this...sounds like Anony can provide some guidance with his better tools and experience.

Grant

@anony: Is there a way to determine the sp500 constituents ranked by market cap...for prior years? Say from 2008 - current?