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

Hi,
Can anyone help me setup a custom factor that checks if the gold price is above it's 10 day moving average?
I tried to read the relevant help lesson here: https://www.quantopian.com/tutorials/pipeline#lesson10 and I understand that one can pull gold prices from Quandle like this: https://www.quantopian.com/data/quandl/bundesbank_bbk01_wt5511 - - -
But somehow I can't seem to be able to practically connect these into a working factor.
Can anyone please help?

1 response

Attached is an algorithm with some ideas. Take a look. You will need to use a simple custom factor.

It has two versions. Version 1 uses 2 factors, one for current price and one for average price. A filter is constructed by comparing the two. Version 2 simply does that comparison within a single custom factor. Both return the same value.

One problem I see is that the quandl data notebook that is referenced on the data page doesn't use the latest method for retrieving single column data sets. Take a look at this post on that change https://www.quantopian.com/posts/upcoming-changes-to-quandl-datasets-in-pipeline-vix-vxv-etc-dot

Hope that helps a bit.