Hi there!
New to the forums here, and really enjoying getting up and running on Quantopian.
Not sure if this question is a fit for the forums or not, but here it is:
From the "Combining and Ranking" algorithm in the documentation, why was this factor chosen to rank securities:
# Combined factors to create new factors
sma_quotient = sma_short / sma_long
What information does sma_quotient
give you? Why would you rank on it? Or was it just arbitrarily chosen for the sake of example?
Here's some additional code for context:
# Combined factors to create new factors
sma_quotient = sma_short / sma_long
# Create and apply a screen to remove penny stocks
remove_penny_stocks = sma_short > 1.0
sma_rank = sma_quotient.rank(mask=remove_penny_stocks)
# Rank a factor using a mask to ignore the values we're
# filtering out by passing mask=remove_penny_stocks to rank.
pipe.add(sma_rank, 'sma_rank')
longs = sma_rank.top(200, mask=remove_penny_stocks)
shorts = sma_rank.bottom(200, mask=remove_penny_stocks)
pipe.add(longs, 'longs')
pipe.add(shorts, 'shorts')
The rest of the code should be available in the backtest. Please let me know if you need more info!