Hi All,
Let me start by confessing that I am a complete novice to programming. Needless to say, I feel more than a little out of sorts when using Quantopian.
That said, I have been trying to code an algorithm for a strategy that I have often tested in excel.
Theory: ETF's are supposed to trade at or very near their NAV's. The degree of variation from the NAV may vary between ETF's and depends on various factors, but for a lone ETF, it should remain within an consistent range.
What we know: Often an ETF will trade above it's NAV and beyond the normal range of variation. This is usually caused by an excess of demand from the market, The normal method of correction for this is for the AP to buy more 'Creation Units' (buys units at NAV, sells at mkt price and makes a risk free profit)
Strategy: Buy 1,000 shares if the opening price is lower than the closing price (NAV) and short sell 1,000 shares if the opening price is higher than the closing price (NAV). This would translate to a trade a day i think
I wasn't sure on how to bring the NAV's into the algorithm and substituted the closing price in it's place, since ETF's always seem to close at or near their NAV for the day.
I am not sure of the following:
- is the algo closing the position at the end of each day?
- is it doing what I think it is doing (i.e. the strategy above)
Thanks,
GL