Created
December 28, 2021 21:02
-
-
Save bnsheehy/cc7111a8f0a0b1e5deb8926aa41620b1 to your computer and use it in GitHub Desktop.
BPI Calculation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.date, SUM(p.signal_name = 'BUY') / COUNT(*) | |
FROM base_pnf_data_historical AS p | |
LEFT JOIN custom_lists AS c ON p.ticker = c.ticker | |
WHERE p.date > '2021-01-01' | |
AND c.list_names LIKE 'SP500%' | |
GROUP BY p.date; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment