Learning the fundamentals API, here's a simple algorithm that buys companies with a high R&D to enterprise value ratio, and holds them for 70 trading days.
- I suspect the results aren't really real. (In general, research shows that high R&D spend results in under-performing stocks, at least in the short term.) Any reason to think otherwise?
- I'm having trouble understanding what's going on with the leverage. The algorithm both checks for open orders and tries to look at liquidity, only buying stocks that have traded at reasonable total dollar volumes in the days before the re-balancing. But the leverage rises to about 2, and never settles much below 1.5. (It should settle back to 1.) The reason is that there are some stocks that are never completely sold - the list of holdings keeps increasing. Why is this ... and how do I fix it?
Thanks for the help!
Alan