コード例 #1
0
    def execute_trade(self):

        trade_type = self.get_selected_trade_type()

        size = self.get_trade_size()
        price = self.get_trade_price()
        total = price * size
        self.set_trade_total(utilities.float2gox(total,
                                                 self.market.curr_quote))

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

        self.status_message(
            'Placing order: {0} {1} {2} at {3} {4} (total {5} {4})...'.
            format(  # @IgnorePep8
                trade_name, utilities.float2str(size,
                                                8), self.market.curr_base,
                utilities.float2str(price, 5), self.market.curr_quote,
                utilities.float2str(total, 6)))

        priceGox = utilities.float2gox(price, self.market.curr_quote)
        sizeGox = utilities.float2gox(size, self.market.curr_base)
        if trade_type == 'BUY':
            self.market.buy(priceGox, sizeGox)
        else:
            self.market.sell(priceGox, sizeGox)
コード例 #2
0
ファイル: view.py プロジェクト: genbtc/goxgui
    def execute_trade(self):

        trade_type = self.get_selected_trade_type()

        size = self.get_trade_size()
        price = self.get_trade_price()
        total = price * size
        self.set_trade_total(utilities.float2gox(total,self.market.curr_quote))

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

        self.status_message('Placing order: {0} {1} {2} at {3} {4} (total {5} {4})...'.format(# @IgnorePep8
            trade_name,
            utilities.float2str(size, 8),
            self.market.curr_base,
            utilities.float2str(price, 5),
            self.market.curr_quote,
            utilities.float2str(total, 6)))
        
        priceGox = utilities.float2gox(price, self.market.curr_quote)
        sizeGox = utilities.float2gox(size, self.market.curr_base)
        if trade_type == 'BUY':
            self.market.buy(priceGox, sizeGox)
        else:
            self.market.sell(priceGox, sizeGox)
コード例 #3
0
ファイル: view.py プロジェクト: genbtc/goxgui
 def recalculate_total(self):
     #When the total button is clicked
     price = self.get_trade_price()
     size = self.get_trade_size()
     #Multiply Price by Size and fill the total edit box in
     total = price * size
     self.set_trade_total(utilities.float2gox(total,self.market.curr_quote))
コード例 #4
0
 def recalculate_total(self):
     #When the total button is clicked
     price = self.get_trade_price()
     size = self.get_trade_size()
     #Multiply Price by Size and fill the total edit box in
     total = price * size
     self.set_trade_total(utilities.float2gox(total,
                                              self.market.curr_quote))
コード例 #5
0
    def recalculate_size(self):
        #When the size button is clicked:
        price = self.get_trade_price()
        if price == 0:
            return

        total = self.get_trade_total()
        #divide Total by Price and fill the size edit box in.
        size = total / price
        self.set_trade_size(utilities.float2gox(size, self.market.curr_base))
コード例 #6
0
ファイル: view.py プロジェクト: genbtc/goxgui
    def recalculate_size(self):
        #When the size button is clicked:
        price = self.get_trade_price()
        if price == 0:
            return

        total = self.get_trade_total()
        #divide Total by Price and fill the size edit box in.
        size = total / price
        self.set_trade_size(utilities.float2gox(size,self.market.curr_base))