Cinderella-Man / hands-on-elixir-and-otp-cryptocurrency-trading-bot-source-code

Resources related to the "Hands-on Elixir & OTP: Cryptocurrency trading bot" book
https://elixircryptobot.com
75 stars 24 forks source link

Chapter 15 - Orders aren't getting saved to the DB... #4

Closed kitplummer closed 3 years ago

kitplummer commented 3 years ago

No errors. Just no orders showing up in the data_warehouse "orders" table.

Verified this with a clean checkout of this repo and cleaned out dbs.

Cinderella-Man commented 3 years ago

Hi @kitplummer :wave:

Thanks for opening the issue (2 issues - but I wasn't fast enough to respond to the first one :wink: )

I just checked out the code(branch chapter_15) and "it works fine on my machine" :stuck_out_tongue:

On a more serious note - your description indicates that probably you didn't run the process to store those orders?

You need to start storing both trade events and orders explicitly:

iex(1)> DataWarehouse.start_storing("trade_events", "NEOUSDT")
...
iex(2)> DataWarehouse.start_storing("orders", "NEOUSDT")
...
iex(3)> Streamer.start_streaming("NEOUSDT")
...
iex(4)> Naive.start_trading("NEOUSDT")
...
17:34:23.477 [info]  The trader(1617467659788) is placing a BUY order for NEOUSDT @ 54.777, quantity: 3.651

psql output:

data_warehouse=# SELECT * FROM orders;
-[ RECORD 1 ]--------------+---------------------------------
order_id                   | 2
client_order_id            | C81E728D9D4C2F636F067F89CC14862C
symbol                     | NEOUSDT
price                      | 54.777
original_quantity          | 3.651
executed_quantity          | 0.00000000
cummulative_quote_quantity | 0.00000000
status                     | FILLED
time_in_force              | GTC
type                       | LIMIT
side                       | BUY
stop_price                 | 0.00000000
iceberg_quantity           | 0.00000000
time                       | 1617467663477
update_time                | 1617467663477
inserted_at                | 2021-04-03 16:36:45
updated_at                 | 2021-04-03 16:36:45
....

Please let me know was that the case?

Thanks in advance,

Kamil

kitplummer commented 3 years ago

I did.

❯ iex -S mix
Erlang/OTP 23 [erts-11.1.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]

Interactive Elixir (1.11.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 12:46:36.836 [info]  DataWarehouse worker is subscribing to orders:xrpusdt
12:46:36.836 [info]  DataWarehouse worker is subscribing to trade_events:xrpusdt
12:46:36.850 [info]  Starting Elixir.Naive.SymbolSupervisor worker for XRPUSDT
12:46:36.886 [info]  Starting new supervision tree to trade on XRPUSDT
12:46:37.231 [info]  Initializing new trader(1617468397230) for XRPUSDT

nil
iex(2)> DataWarehouse.start_storing("orders", "XRPUSDT")
12:46:59.081 [info]  Starting storing data from orders:xrpusdt topic
{:error, {:already_started, #PID<0.410.0>}}
iex(3)> DataWarehouse.Publisher.start_link(%{type: :trade_events, symbol: "XRPUSDT", from: "2019-06-02", to: "2019-06-04", interval: 5})
{:ok, #PID<0.424.0>}
iex(4)> 12:47:10.442 [info]  Publisher broadcasted 0 events
12:47:10.449 [info]  The trader(1617468397230) is placing a BUY order for XRPUSDT @ 0.44391, quantity: 45.0
12:47:10.664 [info]  The trader(1617468397230) is placing a SELL order for XRPUSDT @ 0.44426, quantity: 45.0.
12:47:10.837 [info]  Rebuy triggered for XRPUSDT by the trader(1617468397230)
12:47:10.837 [info]  Starting new trader for XRPUSDT
12:47:10.838 [info]  Initializing new trader(1617468430837) for XRPUSDT
12:47:10.843 [info]  The trader(1617468430837) is placing a BUY order for XRPUSDT @ 0.44376, quantity: 45.0
12:47:10.850 [info]  The trader(1617468430837) is placing a SELL order for XRPUSDT @ 0.44411, quantity: 45.0.
12:47:11.577 [info]  Rebuy triggered for XRPUSDT by the trader(1617468430837)
12:47:11.577 [info]  Starting new trader for XRPUSDT
12:47:11.577 [info]  Initializing new trader(1617468431577) for XRPUSDT
12:47:11.583 [info]  The trader(1617468431577) is placing a BUY order for XRPUSDT @ 0.44319, quantity: 45.1
12:47:11.637 [info]  The trader(1617468431577) is placing a SELL order for XRPUSDT @ 0.44354, quantity: 45.1.
12:47:12.467 [info]  Rebuy triggered for XRPUSDT by the trader(1617468431577)
12:47:12.467 [info]  Starting new trader for XRPUSDT
12:47:12.467 [info]  Initializing new trader(1617468432467) for XRPUSDT
12:47:12.472 [info]  The trader(1617468432467) is placing a BUY order for XRPUSDT @ 0.44275, quantity: 45.1
12:47:12.479 [info]  The trader(1617468432467) is placing a SELL order for XRPUSDT @ 0.4431, quantity: 45.1.
12:47:12.642 [info]  Rebuy triggered for XRPUSDT by the trader(1617468432467)
12:47:12.642 [info]  Starting new trader for XRPUSDT
12:47:12.642 [info]  Initializing new trader(1617468432642) for XRPUSDT
12:47:12.648 [info]  The trader(1617468432642) is placing a BUY order for XRPUSDT @ 0.44228, quantity: 45.2
12:47:12.678 [info]  The trader(1617468432642) is placing a SELL order for XRPUSDT @ 0.44263, quantity: 45.2.
12:47:13.129 [info]  Trader(1617468432642) finished trade cycle for XRPUSDT
12:47:13.129 [info]  XRPUSDT trader finished trade - restarting
12:47:13.129 [info]  Initializing new trader(1617468433129) for XRPUSDT
12:47:13.135 [info]  The trader(1617468433129) is placing a BUY order for XRPUSDT @ 0.44263, quantity: 45.1
12:47:13.147 [info]  The trader(1617468433129) is placing a SELL order for XRPUSDT @ 0.44298, quantity: 45.1.
12:47:13.286 [info]  Rebuy triggered for XRPUSDT by the trader(1617468433129)
12:47:13.286 [info]  All traders already started for XRPUSDT

BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
       (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution

Just nothing when I run the query:

data_warehouse=# select COUNT(*) from orders;
 count
-------
     0
(1 row)

Will keep looking and try re-running your repo again.

Cinderella-Man commented 3 years ago

I can see the issue:

17:33:49.564 [info]  Starting storing data from trade_events:NEOUSDT topic

Symbols in the topics are uppercase - I wonder is there an issue with the book? Checking now...

As per my previous message - orders are getting stored for me so the issue could be only inside the DataWarehouse (where you collect data) or the Trader where you broadcast it.

kitplummer commented 3 years ago

Definitely coding from the book order and source.

Cinderella-Man commented 3 years ago

Could you please double-check your interface inside the DataWarehouse app:

  alias DataWarehouse.Subscriber.DynamicSupervisor

  def start_storing(stream, symbol) do
    DynamicSupervisor.start_worker("#{String.downcase(stream)}:#{String.upcase(symbol)}")
  end

  def stop_storing(stream, symbol) do
    DynamicSupervisor.stop_worker("#{String.downcase(stream)}:#{String.upcase(symbol)}")
  end

It's a mix of lowercase'd and uppercase'd variables

kitplummer commented 3 years ago

Tada. Sorry 'bout that. To cover my ass a bit, I did have knee surgery a week ago, and the meds were probably full-on when I botched typing that in wrong. Thanks again though, for the quick response. Am ready to start really testing some things now - super appreciative of this as a framework.

Cinderella-Man commented 3 years ago

No need to explain yourself - I'm sorry that I asked about the silliest thing (forgetting about running the process) but just wanted to start somewhere and sometimes the simplest things work :slightly_smiling_face:

I think you touched on a very good thing that I observer when I was producing a video out of this chapter - this lowercase and uppercase mix doesn't help and I think I will go back and from the beginning of the book, I will keep topics all uppercase to minimize the checking overhead.

As you are already here - how did you find the book? Anything that I could do to make it better? (besides moving to all uppercase topics :wink:) I'm double impressed that you powered through it after the operation :+1:

I wish you a quick recovery and feel free to reach out if there would be any concerns with the remaining chapters (to be released in the near future)

kitplummer commented 3 years ago

I've really enjoyed working through the book (more so than trying to following along with the videos, which also don't seem to align historical - though I am going through them now that I've gotten through the book).

You might remember, I posted on Youtube after the first video that I couldn't get my bot to "SELL" ever when using the Binance API. Well, that still appears to be true - even after chapter 15. If I run things against the backtest data it appears to work as expected, buying and selling. But if I run for realsies (though against a smaller budget of 100) it never sells. I've not started to debug this in earnest, but am guessing there is something in the actual Binance OrderResponse that isn't matching the right handler.

kitplummer commented 3 years ago

For posterity here's what I see no matter which crypto I pick - just launches the 5 expected traders and then nothing else:

❯ iex -S mix
Erlang/OTP 23 [erts-11.1.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]

==> core
Compiling 2 files (.ex)
Generated core app
==> streamer
Compiling 9 files (.ex)
Generated streamer app
==> binance_mock
Compiling 2 files (.ex)
Generated binance_mock app
==> naive
Compiling 10 files (.ex)
Generated naive app
==> data_warehouse
Compiling 11 files (.ex)
Generated data_warehouse app
Interactive Elixir (1.11.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> DataWarehouse.start_storing("trade_events", "VTHOUSDT")

09:01:56.206 [info]  Starting storing data from trade_events:VTHOUSDT topic

09:01:56.264 [info]  DataWarehouse worker is subscribing to trade_events:VTHOUSDT
{:ok, #PID<0.699.0>}
iex(2)> DataWarehouse.start_storing("orders", "VTHOUSDT")

09:02:12.128 [info]  Starting storing data from orders:VTHOUSDT topic

09:02:12.133 [info]  DataWarehouse worker is subscribing to orders:VTHOUSDT
{:ok, #PID<0.702.0>}
iex(3)> Naive
Naive            NaiveDateTime
iex(3)> Naive.st
start_trading/1    stop_trading/1
iex(3)> Naive.start_trading("VTHOUSDT")

09:02:26.693 [info]  Starting Elixir.Naive.SymbolSupervisor worker for VTHOUSDT

09:02:26.750 [info]  Starting new supervision tree to trade on VTHOUSDT
{:ok, #PID<0.704.0>}
iex(4)>
09:02:27.225 [info]  Initializing new trader(1617627747223) for VTHOUSDT
Streamer.start_streaming("VTHOUSDT")

09:02:40.118 [info]  Starting Elixir.Streamer.Binance worker for VTHOUSDT
{:ok, #PID<0.714.0>}
iex(5)>
09:02:41.080 [info]  The trader(1617627747223) is placing a BUY order for VTHOUSDT @ 0.018368, quantity: 1088.0

09:02:41.641 [info]  Rebuy triggered for VTHOUSDT by the trader(1617627747223)

09:02:41.643 [info]  Starting new trader for VTHOUSDT

09:02:41.643 [info]  Initializing new trader(1617627761643) for VTHOUSDT

09:02:41.809 [info]  The trader(1617627761643) is placing a BUY order for VTHOUSDT @ 0.018354, quantity: 1089.0

09:05:30.742 [info]  Rebuy triggered for VTHOUSDT by the trader(1617627761643)

09:05:30.742 [info]  Starting new trader for VTHOUSDT

09:05:30.742 [info]  Initializing new trader(1617627930742) for VTHOUSDT

09:05:30.743 [info]  The trader(1617627930742) is placing a BUY order for VTHOUSDT @ 0.018329, quantity: 1091.0

09:05:30.894 [info]  Rebuy triggered for VTHOUSDT by the trader(1617627930742)

09:05:30.894 [info]  Starting new trader for VTHOUSDT

09:05:30.894 [info]  Initializing new trader(1617627930894) for VTHOUSDT

09:05:30.926 [info]  The trader(1617627930894) is placing a BUY order for VTHOUSDT @ 0.018352, quantity: 1089.0

09:05:31.035 [info]  Rebuy triggered for VTHOUSDT by the trader(1617627930894)

09:05:31.035 [info]  Starting new trader for VTHOUSDT

09:05:31.035 [info]  Initializing new trader(1617627931035) for VTHOUSDT

09:05:31.251 [info]  The trader(1617627931035) is placing a BUY order for VTHOUSDT @ 0.018304, quantity: 1092.0

09:05:31.768 [info]  Rebuy triggered for VTHOUSDT by the trader(1617627931035)

09:05:31.768 [info]  All traders already started for VTHOUSDT
kitplummer commented 3 years ago

For giggles I backtested the above warehoused events:

iex(1)> DataWarehouse.start_storing("orders", "VTHOUSDT")

09:47:27.917 [info]  Starting storing data from orders:VTHOUSDT topic

09:47:28.080 [info]  DataWarehouse worker is subscribing to orders:VTHOUSDT
{:ok, #PID<0.698.0>}
iex(2)> Naive.start_trading("VTHOUSDT")

09:47:39.318 [info]  Starting Elixir.Naive.SymbolSupervisor worker for VTHOUSDT

09:47:39.339 [info]  Starting new supervision tree to trade on VTHOUSDT
{:ok, #PID<0.700.0>}
iex(3)>
09:47:39.775 [info]  Initializing new trader(1617630459773) for VTHOUSDT
DataWarehouse.Publisher.start_link(%{type: :trade_events, symbol: "VTHOUSDT", from: "2021-04-01", to: "2021-04-06", interval: 5})
{:ok, #PID<0.710.0>}
iex(4)>
09:48:36.521 [info]  Publisher broadcasted 0 events

09:48:36.522 [info]  The trader(1617630459773) is placing a BUY order for VTHOUSDT @ 0.018368, quantity: 1088.0

09:48:36.539 [info]  The trader(1617630459773) is placing a SELL order for VTHOUSDT @ 0.018382, quantity: 1088.0.

09:48:36.546 [info]  Rebuy triggered for VTHOUSDT by the trader(1617630459773)

09:48:36.546 [info]  Starting new trader for VTHOUSDT

09:48:36.547 [info]  Initializing new trader(1617630516547) for VTHOUSDT

09:48:36.634 [info]  The trader(1617630516547) is placing a BUY order for VTHOUSDT @ 0.01834, quantity: 1090.0

09:48:36.643 [info]  Rebuy triggered for VTHOUSDT by the trader(1617630516547)

09:48:36.643 [info]  Starting new trader for VTHOUSDT

09:48:36.643 [info]  Initializing new trader(1617630516643) for VTHOUSDT

09:48:36.643 [info]  The trader(1617630516547) is placing a SELL order for VTHOUSDT @ 0.018354, quantity: 1090.0.

09:48:36.650 [info]  The trader(1617630516643) is placing a BUY order for VTHOUSDT @ 0.01831, quantity: 1092.0

09:48:36.751 [info]  Trader(1617630516547) finished trade cycle for VTHOUSDT

09:48:36.751 [info]  VTHOUSDT trader finished trade - restarting

09:48:36.751 [info]  Initializing new trader(1617630516751) for VTHOUSDT

09:48:36.756 [info]  Trader(1617630459773) finished trade cycle for VTHOUSDT

09:48:36.756 [info]  The trader(1617630516751) is placing a BUY order for VTHOUSDT @ 0.018385, quantity: 1087.0

09:48:36.756 [info]  VTHOUSDT trader finished trade - restarting

09:48:36.756 [info]  Initializing new trader(1617630516756) for VTHOUSDT

09:48:36.768 [info]  The trader(1617630516756) is placing a BUY order for VTHOUSDT @ 0.018356, quantity: 1089.0

09:48:36.768 [info]  Rebuy triggered for VTHOUSDT by the trader(1617630516751)

09:48:36.768 [info]  Starting new trader for VTHOUSDT

09:48:36.769 [info]  Initializing new trader(1617630516768) for VTHOUSDT

09:48:36.769 [info]  The trader(1617630516751) is placing a SELL order for VTHOUSDT @ 0.018399, quantity: 1087.0.

09:48:36.789 [info]  The trader(1617630516768) is placing a BUY order for VTHOUSDT @ 0.018355, quantity: 1089.0

09:48:36.811 [info]  The trader(1617630516756) is placing a SELL order for VTHOUSDT @ 0.01837, quantity: 1089.0.

09:48:36.811 [info]  The trader(1617630516768) is placing a SELL order for VTHOUSDT @ 0.018369, quantity: 1089.0.

09:48:36.824 [info]  Trader(1617630516756) finished trade cycle for VTHOUSDT

09:48:36.824 [info]  Trader(1617630516768) finished trade cycle for VTHOUSDT

09:48:36.824 [info]  VTHOUSDT trader finished trade - restarting

09:48:36.824 [info]  Initializing new trader(1617630516824) for VTHOUSDT

09:48:36.824 [info]  VTHOUSDT trader finished trade - restarting

09:48:36.824 [info]  Initializing new trader(1617630516824) for VTHOUSDT

09:48:36.831 [info]  The trader(1617630516824) is placing a BUY order for VTHOUSDT @ 0.018384, quantity: 1087.0

09:48:36.831 [info]  The trader(1617630516824) is placing a BUY order for VTHOUSDT @ 0.018384, quantity: 1087.0

09:48:36.851 [info]  Rebuy triggered for VTHOUSDT by the trader(1617630516824)

09:48:36.852 [info]  Rebuy triggered for VTHOUSDT by the trader(1617630516824)

09:48:36.852 [info]  Starting new trader for VTHOUSDT

09:48:36.852 [info]  Initializing new trader(1617630516852) for VTHOUSDT

09:48:36.852 [info]  All traders already started for VTHOUSDT

09:48:36.852 [info]  The trader(1617630516824) is placing a SELL order for VTHOUSDT @ 0.018398, quantity: 1087.0.

09:48:36.852 [info]  The trader(1617630516824) is placing a SELL order for VTHOUSDT @ 0.018398, quantity: 1087.0.

09:48:36.863 [info]  The trader(1617630516852) is placing a BUY order for VTHOUSDT @ 0.01838, quantity: 1088.0

09:48:36.903 [info]  Trader(1617630516751) finished trade cycle for VTHOUSDT

09:48:36.903 [info]  Trader(1617630516824) finished trade cycle for VTHOUSDT

09:48:36.903 [info]  Trader(1617630516824) finished trade cycle for VTHOUSDT

09:48:36.903 [info]  VTHOUSDT trader finished trade - restarting

09:48:36.903 [info]  Initializing new trader(1617630516903) for VTHOUSDT

09:48:36.903 [info]  VTHOUSDT trader finished trade - restarting

09:48:36.904 [info]  Initializing new trader(1617630516903) for VTHOUSDT

09:48:36.904 [info]  VTHOUSDT trader finished trade - restarting

09:48:36.904 [info]  Initializing new trader(1617630516904) for VTHOUSDT

09:48:36.908 [info]  The trader(1617630516903) is placing a BUY order for VTHOUSDT @ 0.018385, quantity: 1087.0

09:48:36.909 [info]  The trader(1617630516903) is placing a BUY order for VTHOUSDT @ 0.018385, quantity: 1087.0

09:48:36.909 [info]  The trader(1617630516904) is placing a BUY order for VTHOUSDT @ 0.018385, quantity: 1087.0

09:48:37.031 [info]  Rebuy triggered for VTHOUSDT by the trader(1617630516852)

09:48:37.032 [info]  Rebuy triggered for VTHOUSDT by the trader(1617630516903)

09:48:37.032 [info]  Rebuy triggered for VTHOUSDT by the trader(1617630516903)

09:48:37.032 [info]  Rebuy triggered for VTHOUSDT by the trader(1617630516904)

09:48:37.032 [info]  All traders already started for VTHOUSDT

09:48:37.032 [info]  All traders already started for VTHOUSDT

09:48:37.032 [info]  All traders already started for VTHOUSDT

09:48:37.032 [info]  All traders already started for VTHOUSDT

09:48:37.032 [info]  The trader(1617630516852) is placing a SELL order for VTHOUSDT @ 0.018394, quantity: 1088.0.

09:48:37.033 [info]  The trader(1617630516903) is placing a SELL order for VTHOUSDT @ 0.018399, quantity: 1087.0.

09:48:37.033 [info]  The trader(1617630516903) is placing a SELL order for VTHOUSDT @ 0.018399, quantity: 1087.0.

09:48:37.033 [info]  The trader(1617630516904) is placing a SELL order for VTHOUSDT @ 0.018399, quantity: 1087.0.

09:48:37.038 [info]  Trader(1617630516852) finished trade cycle for VTHOUSDT

09:48:37.038 [info]  VTHOUSDT trader finished trade - restarting

09:48:37.038 [info]  Initializing new trader(1617630517038) for VTHOUSDT

09:48:37.045 [info]  Trader(1617630516903) finished trade cycle for VTHOUSDT

09:48:37.046 [info]  The trader(1617630517038) is placing a BUY order for VTHOUSDT @ 0.018398, quantity: 1087.0

09:48:37.047 [info]  VTHOUSDT trader finished trade - restarting

09:48:37.047 [info]  Initializing new trader(1617630517047) for VTHOUSDT

09:48:37.048 [info]  Trader(1617630516903) finished trade cycle for VTHOUSDT

09:48:37.048 [info]  Trader(1617630516904) finished trade cycle for VTHOUSDT

09:48:37.048 [info]  VTHOUSDT trader finished trade - restarting

09:48:37.048 [info]  Initializing new trader(1617630517048) for VTHOUSDT

09:48:37.048 [info]  VTHOUSDT trader finished trade - restarting

09:48:37.048 [info]  Initializing new trader(1617630517048) for VTHOUSDT

09:48:37.049 [info]  Rebuy triggered for VTHOUSDT by the trader(1617630517038)

09:48:37.049 [info]  The trader(1617630517047) is placing a BUY order for VTHOUSDT @ 0.018349, quantity: 1089.0

09:48:37.049 [info]  The trader(1617630517048) is placing a BUY order for VTHOUSDT @ 0.018349, quantity: 1089.0

09:48:37.049 [info]  All traders already started for VTHOUSDT

09:48:37.049 [info]  The trader(1617630517048) is placing a BUY order for VTHOUSDT @ 0.018349, quantity: 1089.0

09:48:37.050 [info]  The trader(1617630517038) is placing a SELL order for VTHOUSDT @ 0.018412, quantity: 1087.0.

09:48:37.562 [info]  Trader(1617630517038) finished trade cycle for VTHOUSDT

09:48:37.562 [info]  VTHOUSDT trader finished trade - restarting

09:48:37.562 [info]  Initializing new trader(1617630517562) for VTHOUSDT

09:48:37.567 [info]  The trader(1617630517562) is placing a BUY order for VTHOUSDT @ 0.018412, quantity: 1086.0

09:48:37.573 [info]  The trader(1617630517562) is placing a SELL order for VTHOUSDT @ 0.018426, quantity: 1086.0.

09:48:37.789 [info]  Trader(1617630517562) finished trade cycle for VTHOUSDT

09:48:37.789 [info]  VTHOUSDT trader finished trade - restarting

09:48:37.789 [info]  Initializing new trader(1617630517789) for VTHOUSDT

09:48:37.794 [info]  The trader(1617630517789) is placing a BUY order for VTHOUSDT @ 0.018426, quantity: 1085.0

09:48:37.886 [info]  The trader(1617630517789) is placing a SELL order for VTHOUSDT @ 0.01844, quantity: 1085.0.

09:48:37.917 [info]  Rebuy triggered for VTHOUSDT by the trader(1617630517789)

09:48:37.917 [info]  All traders already started for VTHOUSDT

09:48:38.607 [info]  Trader(1617630517789) finished trade cycle for VTHOUSDT

09:48:38.607 [info]  VTHOUSDT trader finished trade - restarting

09:48:38.607 [info]  Initializing new trader(1617630518607) for VTHOUSDT

09:48:38.613 [info]  The trader(1617630518607) is placing a BUY order for VTHOUSDT @ 0.018416, quantity: 1086.0

See, there are SELLs when using BinanceMock client instead of Binance.

kitplummer commented 3 years ago

Well, I figured it out. Duh, the stream and the API have to both be .us or not. Can't mix and match. :D

Cinderella-Man commented 3 years ago

@kitplummer Thank you very much for your response - I was planning to sit down and investigate your logs/issue but it looks like you were faster - sorry Easter - family demands time 🐇 🥚

I've really enjoyed working through the book (more so than trying to following along with the videos, which also don't seem to align historical - though I am going through them now that I've gotten through the book).

So videos started mid-2020 - and I've learnt some lessons on the way which I've put into the book, streamlined stuff and fixed issues. The biggest difference is between them regards chronological order is that book introduces BinanceMock as quickly as it's possible where videos introduce them quite late as I wasn't aware that people don't want to open Binance accounts 🤦‍♂️

Well, I figured it out. Duh, the stream and the API have to both be .us or not. Can't mix and match. :D

I'm so so happy that you figured this out as it would be a nightmare to debug it for me 😀 "configuration issue" - one of the worst ones.

Thank you once again for your feedback and kind words - I'm super excited that you enjoyed it ❤️

Best of luck and hopefully e-see you around 😉