Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Factor Relative Strength Tilting

G'Day Mates,

Listening to the latest episode of Bloomberg's MIB podcast, I wanted to see if I could create a 'factor tilting' framework, as discussed by Andrew Ang (head of factor investing at Blackrock) in the episode. Unfortunately my python programming skills are not good enough to be able to do this on my own, so I thought I'd reach out to the community to see if someone is able and willing to help create such a framework.

The attached strategy has four very basic factors based on Value, Quality, Momentum, and Growth, and are currently (statically) equally weighted at 25% each (after winsorized and normalized/zscored). If I understand it correctly, a 'relative strength factor tilting' would give more/less weight based on each factors relative strength as compared to the other three factors. Perhaps by using average rolling Returns of each factor during some look-back window (say last 6 months) as a measure of 'strength'? Each factor's relative strength can then be used as either over-weight/tilt or under-weigth/tilt, depending on if one believes in factor strength Momentum or Reversal.

I'm not sure if the Q built-in RSI factor can be used for this purpose, or if creating a specific CustomFactor is needed, or if it's better to create individual CustomFactors for the above four factors, and then use them as input in the factor relative strength calculation (inside or outside of a Pipeline?), similar to what @Grant does in his Cluster of Factors algo?

If anyone would be willing to help creating this 'relative strength factor tilting' framework, I'd be very grateful.

4 responses

Bumping, hoping someone is able to help with this.

@Joakim,
Just changed your "Value" factor to one with more bang-for-the-buck...fcf_yield...
A bit better returns.
alan

@Joakim,

In addition to what Alan did:

Replaced AdvMomentum252 by simple one.

momentum = Returns(window_length = 253) - Returns(window_length = 22)  

Removed winsorize().
Replaced zscore() by rank().

def make_pipeline():

    universe = QTradableStocksUS()  
    momentum = Returns(window_length = 253) - Returns(window_length = 22)  
    growth = msf.equity_per_share_growth.latest  
    quality = msf.roic.latest  
    # value = msf.ebit.latest / msf.enterprise_value.latest  
    value = msf.fcf_yield.latest

    screen = (universe  
            & momentum.notnan()  
            & growth.notnan()  
            & quality.notnan()  
            & value.notnan()  
            )  
    combined_factor = (momentum.rank(mask = screen)  
                       + growth.rank(mask = screen)  
                       + quality.rank(mask = screen)  
                       + value.rank(mask = screen)  
                       )  
    pipe = Pipeline(columns={'combined_factor': combined_factor, }, screen = screen)

    return pipe

Total Returns
19.05%
Benchmark Returns
76.04%
Alpha
0.05
Beta
-0.02
Sharpe
1.28
Sortino
1.90
Volatility
0.04
Max Drawdown
-5.42%

Reduced TOTAL_POSITIONS to 300.

Total Returns
27.86%
Benchmark Returns
76.04%
Alpha
0.08
Beta
-0.03
Sharpe
1.46
Sortino
2.20
Volatility
0.05
Max Drawdown
-5.53%

Unfortunately I unable to attach backtest more then 2 years.

Bumping again hoping someone can help with this. I’m looking for the RSI of each factor’s 6 month **returns* * (ideally specific returns), not the relative strength of the factor value, and dynamically change the factor weights based on this. Is this possible in the IDE? Calling out to any Quantopian Python gurus.