예제 #1
0
파일: model.py 프로젝트: tzarskyz/goxgui
    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
예제 #2
0
파일: model.py 프로젝트: genbtc/goxgui
    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
예제 #3
0
파일: model.py 프로젝트: benz1/goxgui
    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
예제 #4
0
파일: view.py 프로젝트: tzarskyz/goxgui
 def get_trade_total(self):
     value = self.mainWindow.doubleSpinBoxTotal.value()
     return utilities.float2internal(value)
예제 #5
0
파일: view.py 프로젝트: tzarskyz/goxgui
 def get_trade_price(self):
     value = self.mainWindow.doubleSpinBoxPrice.value()
     return utilities.float2internal(value)
예제 #6
0
파일: view.py 프로젝트: benz1/goxgui
 def get_trade_size(self):
     value = self.ui.doubleSpinBoxBtc.value()
     return utilities.float2internal(value)
예제 #7
0
 def get_trade_total(self):
     value = self.mainWindow.doubleSpinBoxTotal.value()
     return utilities.float2internal(value)
예제 #8
0
 def get_trade_price(self):
     value = self.mainWindow.doubleSpinBoxPrice.value()
     return utilities.float2internal(value)