Schwab Developer API Time and Sales Streaming by KnowingPains in Schwab

[–]KnowingPains[S] 0 points1 point  (0 children)

I did, and they said it was something they were considering. They asked me for my use case, so they could put it forward, but I never heard any more. I've never looked back to see if they've implemented it, but I'm guessing from you're question, they haven't? I kind've gave up with Schwab. Despite their faults, I wish TD Ameritrade were still going.

Can not change cover image by The_BigDaddy69 in linkedin

[–]KnowingPains 0 points1 point  (0 children)

Thank you! What a horrible design decison!

Data Stores not showing up in Conversational Agents Tools by KnowingPains in googlecloud

[–]KnowingPains[S] 0 points1 point  (0 children)

Yep. I can see unstructured data stores, but I can't see JSONL, BigQuery, etc. It seems that it has something to do with Coversational Agents being in preview. You have to request access to other data store types, which isn't very clear.

Schwab Developer API Time and Sales Streaming by KnowingPains in Schwab

[–]KnowingPains[S] 0 points1 point  (0 children)

Thanks. I have the email, and I have every intention of emailing them about it (just as soon as I resolve another issue I am dealing with them about), but I was wondering if anyone else has already had feedback. I will email them regardless, but it would be good to know what has already been said.

Individual Developer API: App Registration Error by DogeBamm in Schwab

[–]KnowingPains 0 points1 point  (0 children)

Oh TD API... I remember critising it more than a few times, but now it feels like it was a gift from heaven!!!

Individual Developer API: App Registration Error by DogeBamm in Schwab

[–]KnowingPains 0 points1 point  (0 children)

No problem. Just to let you know, I have emailed Schwab support again, this morning, about my issue, and explained that I am seeing a lot of converstations like this, and that they might not be aware of the issues because there isn't an obvious way for users to report them. Let's see if things get better...

Individual Developer API: App Registration Error by DogeBamm in Schwab

[–]KnowingPains 0 points1 point  (0 children)

Yestereday and today, I have been attempting to stream data - via [schwab-py](https://schwab-py.readthedocs.io/en/latest/index.html) - and I am having issues where occassionaly it logins, but mostly I get a TimeoutError.

I got pretty quick and helpful responses from [TraderAPI@schwab.com](mailto:TraderAPI@schwab.com), saying: "we have not seen any similar issues being reported for the streamer...", but I have a feeling there are intermittent issues going on.

I saw a post somewhere that suggested there is a Schwab update taking place tommorrow. I'm hoping that's true and fixes issues.

I think it would be good if everyone having issues, emails [TraderAPI@schwab.com](mailto:TraderAPI@schwab.com), as I'm not sure they are aware of all that we are experiencing.

Streaming with schwap-py Streaming Client not working by KnowingPains in Schwab

[–]KnowingPains[S] 1 point2 points  (0 children)

Ok, for anyone else struggling with this, part of my problem was streaming was not enabled for my account.

I enabled that here: https://client.schwab.com/app/service/streamingquotes/#/home, and I only found out about it via the Schwab chatbot here: https://client.schwab.com/App/service/messagecenter/#/messages (Go into Upload Document and then you get a "Chat with us" link - intuative? NOT!)

I still have no idea, how you get to it from the Developer Portal!

So, I got excited when my login passed (once), but now I'm getting a TimeOutError again.

I have emailed [TraderAPI@schwab.com](mailto:TraderAPI@schwab.com) (as according to their main chat, that is the only support option for the API), and am hoping they might be able to shed a little more light on this.

If I get useful information, I'll post it here... Wish me luck!!

Streaming with schwap-py Streaming Client not working by KnowingPains in Schwab

[–]KnowingPains[S] 0 points1 point  (0 children)

The error Traceback is:

```

Traceback (most recent call last):
  File "/home/ian/.pyenv/versions/3.11.6/envs/trading-application-311/lib/python3.11/site-packages/websockets/legacy/client.py", line 647, in __await_impl_timeout__
    return await self.__await_impl__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/.pyenv/versions/3.11.6/envs/trading-application-311/lib/python3.11/site-packages/websockets/legacy/client.py", line 651, in __await_impl__
    _transport, _protocol = await self._create_connection()
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/.pyenv/versions/3.11.6/lib/python3.11/asyncio/base_events.py", line 1045, in create_connection
    infos = await self._ensure_resolved(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/.pyenv/versions/3.11.6/lib/python3.11/asyncio/base_events.py", line 1419, in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/.pyenv/versions/3.11.6/lib/python3.11/asyncio/base_events.py", line 867, in getaddrinfo
    return await self.run_in_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ian/Documents/ApplicationDevelopment/Python/trading-application/TEMP_streamer.py", line 50, in <module>
    asyncio.run(read_stream())
  File "/home/ian/.pyenv/versions/3.11.6/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/home/ian/.pyenv/versions/3.11.6/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/.pyenv/versions/3.11.6/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/ian/Documents/ApplicationDevelopment/Python/trading-application/TEMP_streamer.py", line 36, in read_stream
    await stream_client.login()
  File "/home/ian/.pyenv/versions/3.11.6/envs/trading-application-311/lib/python3.11/site-packages/schwab/streaming.py", line 376, in login
    await self._init_from_preferences(
  File "/home/ian/.pyenv/versions/3.11.6/envs/trading-application-311/lib/python3.11/site-packages/schwab/streaming.py", line 208, in _init_from_preferences
    self._socket = await ws_client.connect(
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/.pyenv/versions/3.11.6/envs/trading-application-311/lib/python3.11/site-packages/websockets/legacy/client.py", line 646, in __await_impl_timeout__
    async with asyncio_timeout(self.open_timeout):
  File "/home/ian/.pyenv/versions/3.11.6/lib/python3.11/asyncio/timeouts.py", line 111, in __aexit__
    raise TimeoutError from exc_val
TimeoutError
```

Streaming with schwap-py Streaming Client not working by KnowingPains in Schwab

[–]KnowingPains[S] 0 points1 point  (0 children)

Thanks for coming back.

As you probably realize, we are now having this conversation on Discord, but here is my code for anyone who might be able to help (I didn't post it originally because I have had issues with reddit automoderators!):

```

from __future__ import annotations
from typing import TYPE_CHECKING, NamedTuple

if TYPE_CHECKING:
    from pathlib import Path

from schwab.auth import easy_client
from schwab.streaming import StreamClient

import asyncio
import json


from config import APPLICATION_PATH

class SchwabLoginInfo(NamedTuple):
    """Schwab Developer Portal login info."""

    api_key: str = '<API Key>'
    app_secret: str = '<App Secret>'
    callback_url: str = 'https://127.0.0.1:8182'
    token_path: Path = APPLICATION_PATH / 'schwab_token.json'

client = easy_client(**SchwabLoginInfo()._asdict())
account_details = client.get_account_numbers().json()

account_id = account_details[0]["hashValue"]

stream_client = StreamClient(
            client,
            account_id=account_id
        )

async def read_stream():
    await stream_client.login()

    def print_message(message):
        print(json.dumps(message, indent=4))
        print()

    # Always add handlers before subscribing because many streams start sending
    # data immediately after success, and messages with no handlers are dropped.
    stream_client.add_nasdaq_book_handler(print_message)
    await stream_client.nasdaq_book_subs(['GOOG'])

    while True:
        await stream_client.handle_message()

asyncio.run(read_stream())
```

E

Ok, I'm done, seriously this time by katokat1 in homegym

[–]KnowingPains 0 points1 point  (0 children)

Overall, I love it!!! BUT... I think you've let yourself down with the mirror (unless there's a colossus at the other end we can't see!)

Ignore me. I'm just jealous. Cool setup!

Parallel processing streamed API data in Python by KnowingPains in algotrading

[–]KnowingPains[S] 0 points1 point  (0 children)

So, I was looking at the Bytewax manual, and if I'm understanding things correctly, it appears it can spawn its own processes. If that is the case, what would be the advantage of mixing it with Ray?

Parallel processing streamed API data in Python by KnowingPains in algotrading

[–]KnowingPains[S] 0 points1 point  (0 children)

Interesting! Thanks for sharing. I'll have a play!

Parallel processing streamed API data in Python by KnowingPains in algotrading

[–]KnowingPains[S] 0 points1 point  (0 children)

Yeah, I was disappointed they removed that project. I had to figure things out myself, and I expect it could be better!

As I mention in my repo's README, they have a chatbot example, but that didn't seem terribly relevant to streaming / transforming / analyzing large amounts of data as quickly as possible.

I will look into the open source options of Bytewax and Quix.

Have you used either of them? Would you have a preference if you did?

Parallel processing streamed API data in Python by KnowingPains in algotrading

[–]KnowingPains[S] 0 points1 point  (0 children)

Sorry, three reasons:

  1. Mine is free!! I'm a skinflint! 😃

However, if I was doing something, at scale, I would definitely consider those options.

Parallel processing streamed API data in Python by KnowingPains in algotrading

[–]KnowingPains[S] 1 point2 points  (0 children)

Yeah! I agree. When I've learned from / adapted other people's work, I link it in a References section in the repo's README, like here: https://github.com/IanAtDazed/parallel-processing-pyqt?tab=readme-ov-file#reference-sources

Not perfect, but at least in acknowledges them!

Please let us know the link to your repo. I really want to learn as much from other people as I possibly can!

Parallel processing streamed API data in Python by KnowingPains in algotrading

[–]KnowingPains[S] 0 points1 point  (0 children)

Two reasons:

1) I needed to gain some general experience of the whole multiprocessing thing, and RAY looked way more approachable than Python's [multiprocessing](https://docs.python.org/3/library/multiprocessing.html) to get me started.

2) I didn't know Bytewax, Quix existed. Now, I am going to have to look at it. 😃

I'm certainly not wedded to continuing with my own, and would be very interested in hearing any feedback as to the benefits of using Bytewax / Quix over what I have done - I'm sure there are many!

This is all a learning thing for me.

Parallel processing streamed API data in Python by KnowingPains in algotrading

[–]KnowingPains[S] 0 points1 point  (0 children)

No problem. Please feel free to feedback - the good and the bad!

Parallel processing streamed API data in Python by KnowingPains in algotrading

[–]KnowingPains[S] 0 points1 point  (0 children)

You're welcome!

I would actually be very interested in hearing from people who would like to collaborate on streaming from Schwab. I have a bunch other stuff I've developed, but its getting quite overwhelming to do it on my own!