def __parse_data(self, book): ''' Parses the incoming data from gox, converts money values to our internal money format ''' data_in = self._get_data_from_book(book) data_out = [] total = 0 count = 1 vwap = 0 vsize = 0 for x in data_in: price = x.price size = x.volume vsize += size vwap += price * size total += size if vsize > utilities.float2internal(self.GROUP_ORDERS): vwap = utilities.gox2internal(vwap / vsize, 'USD') vsize = utilities.gox2internal(vsize, 'BTC') total = utilities.gox2internal(total, 'BTC') data_out.append([vwap, vsize, total]) count = 1 vwap = 0 vsize = 0 else: count += 1 return data_out
def __parse_data(self, book): ''' Parses the incoming data from gox, converts money values to our internal money format. ''' data_out = [] count = 1 total = 0 vwap = 0 vsize = 0 group_size = utilities.float2internal(self.preferences.GROUP_ORDERS) for x in book: vsize += x.volume vwap += x.price * x.volume total += x.volume if vsize > group_size: vwap = vwap / vsize data_out.append([vwap, vsize, total]) count = 1 vwap = 0 vsize = 0 else: count += 1 return data_out
def __parse_data(self, book): ''' Parses the incoming data from gox, converts money values to our internal money format. ''' data_in = self._get_data_from_book(book) data_out = [] total = 0 count = 1 vwap = 0 vsize = 0 for x in data_in: price = x.price size = x.volume vsize += size vwap += price * size total += size if vsize > utilities.float2internal(self.GROUP_ORDERS): vwap = utilities.gox2internal(vwap / vsize, 'USD') vsize = utilities.gox2internal(vsize, 'BTC') total = utilities.gox2internal(total, 'BTC') data_out.append([vwap, vsize, total]) count = 1 vwap = 0 vsize = 0 else: count += 1 return data_out
def get_trade_total(self): value = self.mainWindow.doubleSpinBoxTotal.value() return utilities.float2internal(value)
def get_trade_price(self): value = self.mainWindow.doubleSpinBoxPrice.value() return utilities.float2internal(value)
def get_trade_size(self): value = self.ui.doubleSpinBoxBtc.value() return utilities.float2internal(value)