Example #1
0
 def sell(self, price, size):
     '''
     Places sell order
     '''
     sizeGox = utilities.internal2gox(size, 'BTC')
     priceGox = utilities.internal2gox(price, 'USD')
     self.gox.sell(priceGox, sizeGox)
Example #2
0
 def buy(self, price, size):
     '''
     Places buy order
     '''
     sizeGox = utilities.internal2gox(size, 'BTC')
     priceGox = utilities.internal2gox(price, 'USD')
     self.gox.buy(priceGox, sizeGox)
Example #3
0
    def execute_trade(self):

        trade_type = self.get_selected_trade_type()

        size = self.get_trade_size()
        price = self.get_trade_price()
        total = self.get_trade_total()

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

        self.status_message('Placing order: {0} {1} BTC at {2} USD (total {3} USD)...'.format(# @IgnorePep8
            trade_name,
            utilities.internal2str(size),
            utilities.internal2str(price, 5),
            utilities.internal2str(total, 5)))

        sizeGox = utilities.internal2gox(size, 'BTC')
        priceGox = utilities.internal2gox(price, 'USD')

        if trade_type == 'BUY':
            self.gox.buy(priceGox, sizeGox)
        else:
            self.gox.sell(priceGox, sizeGox)
Example #4
0
    def execute_trade(self):

        trade_type = self.get_selected_trade_type()

        size = self.get_trade_size()
        price = self.get_trade_price()
        total = self.get_trade_total()

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

        self.status_message(
            'Placing order: {0} {1} BTC at {2} USD (total {3} USD)...'.
            format(  # @IgnorePep8
                trade_name, utilities.internal2str(size),
                utilities.internal2str(price, 5),
                utilities.internal2str(total, 5)))

        sizeGox = utilities.internal2gox(size, 'BTC')
        priceGox = utilities.internal2gox(price, 'USD')

        if trade_type == 'BUY':
            self.gox.buy(priceGox, sizeGox)
        else:
            self.gox.sell(priceGox, sizeGox)