Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Need Help - Modify Algo to Maintain a Set Percentage of Gold at All Times

I'd like to modify the attached algo to maintain a 20% position in gold (using the 'GLD'
ETF).

Current = Buys 5 stocks and rebalances daily

Proposed = Buys 4 stocks (80% of holdings) and holds GLD (20% of holdings). Maintains this configuration after rebalancing.

Questions:
1) Is this possible? If so I'd like to get actual code modifications or a modified algo if someone is willing as my coding skills aren't real strong.

2) Can someone also help with the following warnings?

Your algorithm uses APIs that have been deprecated in favor of newer, more powerful versions. For more information, go here.
Line 109: Function update_universe is deprecated.
Line 45: Checking whether an asset is in data is deprecated.
Line 36: Checking whether an asset is in data is deprecated.
These deprecated APIs will stop working in the future. Please switch to the new APIs as soon as possible.

I would appreciate specifics or code modifications to fix this if possible.

Thanks,

Troy

2 responses

This is a start. I modified the code to reduce the original weights to 0.8, then added code to buy gold at 25% of the total value of those positions.

Thanks Frank! I appreciate the help and quick response. That's what I was looking for on Question #1.

Thanks again,

Troy