-
-
Save ttt733/c8920fec2330293e874300d1a1b2972b to your computer and use it in GitHub Desktop.
Listening for Polygon data updates
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
# Listen for second aggregates and perform trading logic | |
@conn.on(r'A$', [self.symbol]) | |
async def handle_agg(conn, channel, data): | |
# Update price info | |
tick_open = self.last_price | |
tick_close = data.close | |
self.last_price = tick_close | |
conn.run([f'A.{self.symbol}']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment