Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
New Video: Learn from the Experts Ep 1 -- Full Algorithm Creation with Vedran Rusman

In our latest video, Quantopian community member and multiple challenge winner Vedran Rusman gives an inside look into his research process. This video starts with Dr. Thomas Wiecki conducting a short interview about Vedran’s background as a finance professional in Bosnia and continues with Vedran walking the audience through the creation of an estimates factor all the way from inception to implementation, analysis, evaluation, and backtesting, generously sharing his hard-earned wisdom.

As a finance professional himself, Vedran shows how others can use their financial knowledge to help create challenge-worthy factors. He also gives an explanation of the reasoning behind his decisions, allowing you to walk away with a better understanding of how to develop and improve your own factors.

Check out our latest challenge here, where you can test out your skills and create a challenge ready algorithm.

Watch Vedran's factor-development video here, or below:

Learn more by subscribing to our YouTube channel to access all of our videos and be notified when a new one is posted.

As always, if there are any topics you would like us to focus on for future videos, please comment below or send us a quick note at [email protected].

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.

28 responses

Thank you soooo much! 👍👍👍

Null records notebook used in the video

Alphalens tearsheet used in the video

Example Estimates algorithm backtest

Estimates EOD tearsheet

Thank you very much for your video and notebooks that you have attached!

Thanks a lot for this contribution @Vedran!
And @Thomas for the initiative!

Thank you Vedran.

Thank you so much!

Hi @Vedran,

When treating the alpha factor, you first winsorize it (to remove outliers), then rank and then zscore (to get the long and shorts). Why it's not enough to just windsorize and zscore? Do you rank to control the target weight for each stock?

Thanks in advance.

In this specific case I just used default insider competition algorithm template. Personally, I do not rank factors. Zscoring and winsorizing are finishing touches after alpha factor discovery phase is done. I just use them to squeeze most of already great alpha factor.

I see, thanks @Vedran!

Hi Vedran, nice interview. What is the short-term fast moving alpha?

Thank you Tien. When you discover that kind of alpha factor you need to act on it on the same moment in time/day. If you wait for next day or longer, performance will drop drastically. If it takes too long for a portfolio strategy to complete rebalancing cycle that type of behavior becomes the issue.

Ah ok, thanks for the explanation.

Very interesting, thank you both for sharing!

Thanks Vedran. Nice and informative!

Thanks Vedran for sharing!
Do you think that reducing the number of stocks traded to the two extreme percentiles would improve the performance of the algorithm?
Or any positive effect is already carried by the alpha that you have chosen?

You`re welcome.
I think that reduction of the number of stocks traded to the two extreme percentiles would increase volatility since the positions in portfolio end up larger so both maximum return and maximum drawdown would be amplified.

Could you please explain me a little better this fragment of code found in your second posted notebook?

THANKS

result = None

for name, (f,w) in factors.iteritems(): #.items() in Python 3.5  
        if result  == None:  
            result  = w*f(mask=universe)  
        else:  
            result  += w*f(mask=universe)  

This for loop iterates over factors dictionary with .iteritems() method (name of the method got changed in Python 3 version to .items()) by each stock as individual key and calculates corresponding multiplication between values for stocks in defined universe (f - factor value for stock, w - hardcoded weight which in this example was set to 1) into result zipline NumExprFactor variable .

Hi Vedra, Thank You very much for educating us and sharing the material. Could you please advise how we can remove Sector - 'Misc' from the trading universe? As the IC is negative for this group, perhaps removing that sector will improve the returns. It will be interesting to see.

I tried using this but it didnt work.

qtu = QTradableStocksUS() & (~Sector().eq(-1)))  

@Nadeem - I do not know what is the best optimal way to achieve that since that sector filter returns false because of NaN values.
What you can do is try to use explicit filter like this:

qtu = QTradableStocksUS() &
(sector.eq(101) |
sector.eq(102) |
sector.eq(103) |
sector.eq(104) |
sector.eq(205) |
sector.eq(206) |
sector.eq(207) |
sector.eq(308) |
sector.eq(309) |
sector.eq(310) |
sector.eq(311))

Hi Vedran in minute 13:11 you mention "basically there is one factor which is already known to you (Thomas) and the community, the short term fast moving alpha". I have some students participating in the challenges they are asking me about that "known short term fast moving alpha" and I can´t find any post. about. Could you please give us info about that known short term fast moving alpha factor.

Hello German,

That factor is known to some of the algorithm authors who also found it but not to the entire community.
I cannot give you information about that factor since that is 'secret sauce' which is already licensed and under intellectual property protection.

great stuff !

This is really impressive :)

I'm new to Quantopian, and I am trying to make some changes in your code. But I'm facing some difficult in trying to make your Long/Short strategy to become a Long Only strategy. Which part of the code do I have to change in the algorithm to make it ONLY buy the best ones, but not selling the worst ones?

@Leonardo

Try to add following code to rebalance function:

MAX_LONG_POSITION_SIZE = 0.05 #or any other positive position weight

constraints.append(
opt.PositionConcentration.with_equal_bounds(
min=0,
max=MAX_LONG_POSITION_SIZE
))