Successfully connecting to websocket but no data

C# SKD
Funded Live account

Hello, I have been trying to get Live multiple ticker price updates but run into problems. At first I was using GetLastTradeAsync but this limits me to only 1 ticker symbol per api call. I recently tried using GetBarSetAsync which I can get multiple tickers but seems the data is inaccurate, looks like data is stale for minutes and doesn’t update frequent enough. I found that with polygon’s websocket we can stream for multiple ticker symbols. I used the MeanReversionBrokerage example to connect to polygon websocket. It connects, authenticates fine but it never receives any price data and then just closes connection.

Example Code
restClient = new RestClient(API_KEY, API_SECRET, API_URL, apiVersion: 2);
// Connect to Polygon’s websocket and listen for price updates.
polygonSockClient = new PolygonSockClient(API_KEY);
polygonSockClient.ConnectAndAuthenticateAsync().Wait();
Console.WriteLine(“Polygon client opened.”);

        polygonSockClient.SecondAggReceived += async (agg) =>
        {
            Console.WriteLine(agg.Close);
            // Decide whether to buy or sell and submit orders.
            await HandleSecondAgg(agg);

        };
        polygonSockClient.SubscribeSecondAgg(symbol);.`

I’m trying this same code as you have, with the symbol variable in the subscribe method being a List of the symbols i’m wanting updates on. it seems to fire and but i guess as soon as it recieves the next symbols agg it kills the current handle process and starts the next symbol. Did you ever get yours to work, and do you have any idea how to get agg data updates on multiples symbols at once?

1 Like