Ejemplo n.º 1
0
async def load_price():
    url = "wss://price-cmc-04.vndirect.com.vn/realtime/websocket"
    async with websockets.connect(url, ssl=True) as ws:
        logging.info(f"Connected")
        ps = price.Price(ws)
        await ps.subscribe(parser_message.BA, list_id)
        while True:
            msg = await ps.recv()
            logging.info(f"< {str(msg)}")
Ejemplo n.º 2
0
async def load_price():
    url = "wss://price-cmc-04.vndirect.com.vn/realtime/websocket"
    async with websockets.connect(url, ssl=True) as ws:
        logging.info(f"Connected")
        ps = price.Price(ws)
        await ps.subscribe(parser.BA, ["VND", "PNJ"])
        await ps.subscribe(parser.SP, ["VND", "PNJ"])
        await ps.subscribe(parser.DE, ["VN30F1901"])
        await ps.subscribe(parser.MI, ["10", "11", "12", "13", "02", "03"])
        while True:
            msg = await ps.recv()
            logging.info(f"< {str(msg)}")
Ejemplo n.º 3
0
async def load_price():
    url = "wss://price-cmc-04.vndirect.com.vn/realtime/websocket"
    async with websockets.connect(url, ssl=True) as ws:
        logging.info(f"Connected")
        ps = price.Price(ws)

        await ps.subscribe(
            parser_message.MI, ["10", "11", "12", "13", "02", "03"]
        )  #02: HNX - 03: UPCOM - 12: HNX30 - 10: VNINDEX - 11: VN30 - 13: VNXALL
        while True:
            msg = await ps.recv()
            logging.info(f"< {str(msg)}")
Ejemplo n.º 4
0
 def __init__(self):
     self.Price = price.Price()
     self.Price.parse()
     self.Indicator = indicator.Indicator()