首页 > 解决方案 > MACD indicator values (MACD line and signal line) calculated on cryptocurrency (EOS) live price data from Binance WebSocket

问题描述

I want to calculate the values of the MACD indicator. The MACD line and the Signal line. (Fast Lenght = 12) (Slow Lenght = 26) (Signal = 9) I'm connected to the Binance WebSocket and I receive live price data about the crypto pair EOS/USDT that I want to trade. The data I receive looks like this.

  "e": "kline",     // Event type
  "E": 123456789,   // Event time
  "s": "BNBBTC",    // Symbol
  "k": {
"t": 123400000, // Kline start time
"T": 123460000, // Kline close time
"s": "BNBBTC",  // Symbol
"i": "1m",      // Interval
"f": 100,       // First trade ID
"L": 200,       // Last trade ID
"o": "0.0010",  // Open price
"c": "0.0020",  // Close price
"h": "0.0025",  // High price
"l": "0.0015",  // Low price
"v": "1000",    // Base asset volume
"n": 100,       // Number of trades
"x": false,     // Is this kline closed?
"q": "1.0000",  // Quote asset volume
"V": "500",     // Taker buy base asset volume
"Q": "0.500",   // Taker buy quote asset volume
"B": "123456"   // Ignore

How can I calculate the values of the MACD indicator. The MACD line and the Signal line.? From the live price data, I receive.
I basically need to calculate these MACD (MACD line and signal line) values from the live price data.

标签: python

解决方案


推荐阅读