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)
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)
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))
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))
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))
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))