示例#1
0
文件: info.py 项目: dkgeorge/goxgui
    def set_ticker_ask(self, value):

        if value == None:
            text = 'n/a'
        else:
            text = money.to_long_string(value, self.__get_quote_currency())

        self.__set_data(1, 5, text)
示例#2
0
文件: info.py 项目: dkgeorge/goxgui
    def set_wallet_b(self, value):

        if value == None:
            text = 'n/a'
        else:
            text = money.to_long_string(value, self.__get_quote_currency())

        self.__set_data(1, 1, text)
示例#3
0
文件: view.py 项目: kirillseva/goxgui
    def display_userorder(self, price, size, order_type, oid, status):

        if order_type == "":
            self.status_message('Order <a href="{0}">{0}</a> {1}.'.format(oid, status))
            if status == "removed" and self.get_order_id() == oid:
                self.set_order_id("")
        else:
            self.status_message(
                '{0} size: {1}, price: {2}, oid: <a href="{3}">{3}</a> - {4}'.format(  # @IgnorePep8
                    str.upper(str(order_type)),
                    money.to_long_string(size, self.get_base_currency()),
                    money.to_long_string(price, self.get_quote_currency()),
                    oid,
                    status,
                )
            )
            if status == "post-pending":
                self.set_order_id(oid)
示例#4
0
文件: view.py 项目: kirillseva/goxgui
    def set_wallet_b(self, value):

        if value == None:
            self.ui.pushButtonWalletB.setEnabled(False)
            self.ui.pushButtonWalletB.setText("n/a")
            return

        self.ui.pushButtonWalletB.setEnabled(True)
        self.ui.pushButtonWalletB.setText(money.to_long_string(value, self.get_quote_currency()))
示例#5
0
文件: view.py 项目: kirillseva/goxgui
    def execute_trade(self):

        trade_type = self.get_selected_trade_type()

        size = self.get_trade_size()
        price = self.get_trade_price()
        total = money.multiply(price, size)

        trade_name = "BID" if trade_type == "BUY" else "ASK"

        self.status_message(
            "Placing order: {0} {1} at {2} (total {3})...".format(  # @IgnorePep8
                trade_name,
                money.to_long_string(size, self.get_base_currency()),
                money.to_long_string(price, self.get_quote_currency()),
                money.to_long_string(total, self.get_quote_currency()),
            )
        )

        if trade_type == "BUY":
            self.market.buy(price, size)
        else:
            self.market.sell(price, size)
示例#6
0
 def test_to_long_string(self):
     self.assertEquals('2,000.00000 EUR',
         money.to_long_string(200000000000, Currency('EUR')))