Hi there,
I'm new to Quantopian's Pipeline Feature (and still pretty new with FinTech and Python), so bear with me.
What I'm trying to implement (simple momentum strategy):
- Take all ETF's
- Rank them by their average returns over the last N periods
- Rank them by their average Sharpe-Ratio over the last N periods
- Rank them by their average rank form (2) & (3)
- Go long on the top ten (Not yet implemented)
Currently, my code is a clone of the example posted by Karin Rubin here, modified as far as I got.
Questions:
- How can I only work with ETFs in a Pipeline? Do I pass a
mask
toFactor.rank
like Karin did? - How can I work with Sharpe in Factors?
- Can I use the Simple Moving Average on Sharpe? (Because that's essentially what I'm trying to do here)
- Can I use the Simple Moving Average on realtive returns?
- Some other more specific questions to my code and the API as comments in the source (please have a look)
While the Documentation was of some help, I couldn't find anything regarding ETFs or Sharpe, so any guidance and help is appreciated.
Thanks a lot,
Claas M.
EDIT: I just noticed I forgot to delete the initial comment in the source. Can be ignored.