from datetime import datetime


class Ttsi:
    """
    The trade information with price and amount etc.

    :member
        price: The trading price in quote currency.
        amount: The trading volume in base currency.
        trade_id: The unique trade id of this trade.
        timestamp: The UNIX formatted timestamp generated by server in UTC.
        direction: The direction of the taker trade: 'buy' or 'sell'.
    """

    def __init__(self):
        self.buy_ratio = 0.0
        self.sell_ratio = 0.0
        self.locked_ratio = 0.0
        self.timestamp = 0

    @staticmethod
    def json_parse(json_data):
        ttsi = Ttsi()
        ttsi.buy_ratio = json_data.get_float("buy_ratio")
        ttsi.sell_ratio = json_data.get_float("sell_ratio")
        ttsi.locked_ratio = json_data.get_float("locked_ratio")
        ttsi.timestamp = json_data.get_int("ts")
        return ttsi

    def print_object(self, format_data=""):
        from huobi.base.printobject import PrintBasic
        t2 = self.timestamp / 1000
        date_time = datetime.fromtimestamp(t2).strftime("%Y-%m-%d, %H:%M:%S")
        PrintBasic.print_basic(self.buy_ratio, format_data + "buy_ratio")
        PrintBasic.print_basic(self.sell_ratio, format_data + "sell_ratio")
        PrintBasic.print_basic(self.locked_ratio, format_data + "locked_ratio")
        PrintBasic.print_basic(date_time, format_data + "Trade Time")

    def to_str(self):
        date_time = datetime.fromtimestamp(self.timestamp / 1000).strftime("%Y-%m-%d, %H:%M:%S")
        aa = """ TTSI
        Trade Time: {},buy_ratio: {} , sell_ratio: {},  locked_ratio: {}""".format(date_time,self.buy_ratio, self.sell_ratio, self.locked_ratio )
        return aa

82d1ed6dc1b9c07cf998887ccd73aeb76b4eb9b1
<mask token>


class Ttsi:
    <mask token>
    <mask token>
    <mask token>

    def print_object(self, format_data=''):
        from huobi.base.printobject import PrintBasic
        t2 = self.timestamp / 1000
        date_time = datetime.fromtimestamp(t2).strftime('%Y-%m-%d, %H:%M:%S')
        PrintBasic.print_basic(self.buy_ratio, format_data + 'buy_ratio')
        PrintBasic.print_basic(self.sell_ratio, format_data + 'sell_ratio')
        PrintBasic.print_basic(self.locked_ratio, format_data + 'locked_ratio')
        PrintBasic.print_basic(date_time, format_data + 'Trade Time')

    def to_str(self):
        date_time = datetime.fromtimestamp(self.timestamp / 1000).strftime(
            '%Y-%m-%d, %H:%M:%S')
        aa = (
            """ TTSI
        Trade Time: {},buy_ratio: {} , sell_ratio: {},  locked_ratio: {}"""
            .format(date_time, self.buy_ratio, self.sell_ratio, self.
            locked_ratio))
        return aa

<mask token>


class Ttsi:
    <mask token>

    def __init__(self):
        self.buy_ratio = 0.0
        self.sell_ratio = 0.0
        self.locked_ratio = 0.0
        self.timestamp = 0

    @staticmethod
    def json_parse(json_data):
        ttsi = Ttsi()
        ttsi.buy_ratio = json_data.get_float('buy_ratio')
        ttsi.sell_ratio = json_data.get_float('sell_ratio')
        ttsi.locked_ratio = json_data.get_float('locked_ratio')
        ttsi.timestamp = json_data.get_int('ts')
        return ttsi

    def print_object(self, format_data=''):
        from huobi.base.printobject import PrintBasic
        t2 = self.timestamp / 1000
        date_time = datetime.fromtimestamp(t2).strftime('%Y-%m-%d, %H:%M:%S')
        PrintBasic.print_basic(self.buy_ratio, format_data + 'buy_ratio')
        PrintBasic.print_basic(self.sell_ratio, format_data + 'sell_ratio')
        PrintBasic.print_basic(self.locked_ratio, format_data + 'locked_ratio')
        PrintBasic.print_basic(date_time, format_data + 'Trade Time')

    def to_str(self):
        date_time = datetime.fromtimestamp(self.timestamp / 1000).strftime(
            '%Y-%m-%d, %H:%M:%S')
        aa = (
            """ TTSI
        Trade Time: {},buy_ratio: {} , sell_ratio: {},  locked_ratio: {}"""
            .format(date_time, self.buy_ratio, self.sell_ratio, self.
            locked_ratio))
        return aa

<mask token>


class Ttsi:
    """
    The trade information with price and amount etc.

    :member
        price: The trading price in quote currency.
        amount: The trading volume in base currency.
        trade_id: The unique trade id of this trade.
        timestamp: The UNIX formatted timestamp generated by server in UTC.
        direction: The direction of the taker trade: 'buy' or 'sell'.
    """

    def __init__(self):
        self.buy_ratio = 0.0
        self.sell_ratio = 0.0
        self.locked_ratio = 0.0
        self.timestamp = 0

    @staticmethod
    def json_parse(json_data):
        ttsi = Ttsi()
        ttsi.buy_ratio = json_data.get_float('buy_ratio')
        ttsi.sell_ratio = json_data.get_float('sell_ratio')
        ttsi.locked_ratio = json_data.get_float('locked_ratio')
        ttsi.timestamp = json_data.get_int('ts')
        return ttsi

    def print_object(self, format_data=''):
        from huobi.base.printobject import PrintBasic
        t2 = self.timestamp / 1000
        date_time = datetime.fromtimestamp(t2).strftime('%Y-%m-%d, %H:%M:%S')
        PrintBasic.print_basic(self.buy_ratio, format_data + 'buy_ratio')
        PrintBasic.print_basic(self.sell_ratio, format_data + 'sell_ratio')
        PrintBasic.print_basic(self.locked_ratio, format_data + 'locked_ratio')
        PrintBasic.print_basic(date_time, format_data + 'Trade Time')

    def to_str(self):
        date_time = datetime.fromtimestamp(self.timestamp / 1000).strftime(
            '%Y-%m-%d, %H:%M:%S')
        aa = (
            """ TTSI
        Trade Time: {},buy_ratio: {} , sell_ratio: {},  locked_ratio: {}"""
            .format(date_time, self.buy_ratio, self.sell_ratio, self.
            locked_ratio))
        return aa

from datetime import datetime


class Ttsi:
    """
    The trade information with price and amount etc.

    :member
        price: The trading price in quote currency.
        amount: The trading volume in base currency.
        trade_id: The unique trade id of this trade.
        timestamp: The UNIX formatted timestamp generated by server in UTC.
        direction: The direction of the taker trade: 'buy' or 'sell'.
    """

    def __init__(self):
        self.buy_ratio = 0.0
        self.sell_ratio = 0.0
        self.locked_ratio = 0.0
        self.timestamp = 0

    @staticmethod
    def json_parse(json_data):
        ttsi = Ttsi()
        ttsi.buy_ratio = json_data.get_float('buy_ratio')
        ttsi.sell_ratio = json_data.get_float('sell_ratio')
        ttsi.locked_ratio = json_data.get_float('locked_ratio')
        ttsi.timestamp = json_data.get_int('ts')
        return ttsi

    def print_object(self, format_data=''):
        from huobi.base.printobject import PrintBasic
        t2 = self.timestamp / 1000
        date_time = datetime.fromtimestamp(t2).strftime('%Y-%m-%d, %H:%M:%S')
        PrintBasic.print_basic(self.buy_ratio, format_data + 'buy_ratio')
        PrintBasic.print_basic(self.sell_ratio, format_data + 'sell_ratio')
        PrintBasic.print_basic(self.locked_ratio, format_data + 'locked_ratio')
        PrintBasic.print_basic(date_time, format_data + 'Trade Time')

    def to_str(self):
        date_time = datetime.fromtimestamp(self.timestamp / 1000).strftime(
            '%Y-%m-%d, %H:%M:%S')
        aa = (
            """ TTSI
        Trade Time: {},buy_ratio: {} , sell_ratio: {},  locked_ratio: {}"""
            .format(date_time, self.buy_ratio, self.sell_ratio, self.
            locked_ratio))
        return aa

from datetime import datetime


class Ttsi:
    """
    The trade information with price and amount etc.

    :member
        price: The trading price in quote currency.
        amount: The trading volume in base currency.
        trade_id: The unique trade id of this trade.
        timestamp: The UNIX formatted timestamp generated by server in UTC.
        direction: The direction of the taker trade: 'buy' or 'sell'.
    """

    def __init__(self):
        self.buy_ratio = 0.0
        self.sell_ratio = 0.0
        self.locked_ratio = 0.0
        self.timestamp = 0

    @staticmethod
    def json_parse(json_data):
        ttsi = Ttsi()
        ttsi.buy_ratio = json_data.get_float("buy_ratio")
        ttsi.sell_ratio = json_data.get_float("sell_ratio")
        ttsi.locked_ratio = json_data.get_float("locked_ratio")
        ttsi.timestamp = json_data.get_int("ts")
        return ttsi

    def print_object(self, format_data=""):
        from huobi.base.printobject import PrintBasic
        t2 = self.timestamp / 1000
        date_time = datetime.fromtimestamp(t2).strftime("%Y-%m-%d, %H:%M:%S")
        PrintBasic.print_basic(self.buy_ratio, format_data + "buy_ratio")
        PrintBasic.print_basic(self.sell_ratio, format_data + "sell_ratio")
        PrintBasic.print_basic(self.locked_ratio, format_data + "locked_ratio")
        PrintBasic.print_basic(date_time, format_data + "Trade Time")

    def to_str(self):
        date_time = datetime.fromtimestamp(self.timestamp / 1000).strftime("%Y-%m-%d, %H:%M:%S")
        aa = """ TTSI
        Trade Time: {},buy_ratio: {} , sell_ratio: {},  locked_ratio: {}""".format(date_time,self.buy_ratio, self.sell_ratio, self.locked_ratio )
        return aa
