Python Forum
how to manage crypto trading flooding data from exchange servers
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to manage crypto trading flooding data from exchange servers
#1
Hi,
I'm new in Python and even new in this great forum.
I love Python but it's for me a kind of new adventure and I'm learning.

I'm writing an application through which I'm trying to acquire data (a huge quantity of them) from crypto exchange servers.

Basically, I need to acquire live data coming in via WebSocket stream that is working yet!!! (that's a piece of good news, I know!)

I subscribed to the following WebSocket channels (and many others), for which a set of separate data are provided by the servers:
  • BTC/USDT with 1m timeframe
  • BTC/USDT with 5m timeframe
  • BTC/USDT with 15m timeframe
  • ETH/USDT with 1m timeframe
  • ETH/USDT with 5m timeframe
  • ETH/USDT with 15m timeframe

After the activation of the WebSockets channels, the application receives a flooding stream of data constantly.
The coming stream is a single message like this:

{"stream":"btcusdt@kline_1m","data":{"e":"kline","E":1640541646552,"s":"BTCUSDT","k":{"t":1640541600000,"T":1640541659999,"s":"BTCUSDT","i":"1m","f":1965180,"L":1965191,"o":"50377.48000000","c":"50462.84000000","h":"50462.84000000","l":"50246.26000000","v":"0.50152700","n":12,"x":false,"q":"25277.40262797","V":"0.50122900","Q":"25262.42924249","B":"0"}}}

The data provided by those streams are candle live data that I can easily extract.
I need to store data in a data structure for further computations.

Data must be aggregated by
  • crypto pair (like BTCUSDT)
  • time frame (like 1m, 5m, and so on)
  • candle data (every single candle is composed of many separate information like Open Value, High Value, Low Value, Close Value, Volume Value and Timestamp Value)

the first need is that at the program start time I cannot know in advance how many cryptos the application will manage and this can vary even during the running time so I need to "append" new coming cryptos and eventually remove the unnecessary ones,

the second need is that time frame values are basically well known and fixed from the very beginning to the end of the application

third, candle values should be organized like a FIFO register, the oldest should be pushed out and the new one should be stored in the register. The length of the register is fixed to a specific number, let's say 60.

I also need to compute some extra indicators according to the candle close values like EMA (exponential moving average).

Could someone help me with this?
Maybe it is simple, but not for me.
Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Star Pairs Trading Simulation Kiitoos 0 249 Feb-19-2024, 08:27 PM
Last Post: Kiitoos
  python manage variables across project level mg24 1 926 Nov-12-2022, 05:01 AM
Last Post: deanhystad
  How do you manage script? kucingkembar 14 2,740 Oct-15-2022, 06:32 PM
Last Post: Gribouillis
  Creating a TG crypto Bot_ problem when trying to with bot.polling p1ner0 1 1,436 Apr-27-2022, 03:43 AM
Last Post: p1ner0
  Python, how to manage multiple data in list or dictionary with calculations and FIFO Mikeardy 8 2,620 Dec-31-2021, 07:47 AM
Last Post: Mikeardy
  Improves performance on socket multi-threaded servers for object detection pennant 1 1,909 Aug-31-2021, 08:43 AM
Last Post: Larz60+
  cbot ctrader automate trading hl29951 1 1,665 Jul-25-2021, 08:14 PM
Last Post: Larz60+
  API Gateway to manage multiple API's get put data robsuttonjr 2 2,554 Mar-09-2021, 04:09 PM
Last Post: robsuttonjr
  Code should download and output trading data tayy 2 2,658 Mar-04-2021, 04:07 AM
Last Post: tayy
  Manage user names in TRAC susja 3 6,012 Dec-06-2020, 09:34 PM
Last Post: susja

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020