So I have this idea about determining if a stock is under accumulation/distribution.
I have a strong SQL background but still learning python here and I'm stuck. I have two essential pieces of what I need - whether the SPY was up or down by date (using get_pricing) for the last X number of days, and whether all stocks in my universe were up or down in the last X number of days by date (using pipeline). The problem I'm running into is comparing the two - in SQL I'd store them off in a table variable and JOIN them and potentially use CASE statements and various aggregate and ranking functions to get 'er done.
I suspect that what I'm trying to is possible but I'm going about it all wrong. Any help the community could provide would be appreciated!
Details of what I'm trying to do are in the header of the notebook.