예제 #1
0
    def findTradeSummary(self, date, start):
        '''
        A helper method for addTradeSummariesSA and updateTradeSummaries
        Get a single trade summary record by date and time
        :date: A Date string or Timestamp for the date to find.
        :start: A Time string or Timestamp for the time to find
        :return: The found record as a tuple or False
        '''

        x = TradeSum.findByTime(formatDate(date), formatTime(start))
        if x:
            if len(x) > 1:
                logging.error(
                    f'multiple trade summaries found with date:{date}, start: {start}'
                )
            return x[0]

        return False
예제 #2
0
 def getTradeSumByDate(self, daDate):
     sf = self.sf
     tsums = TradeSum.findByTime(formatDate(daDate))
     if not tsums:
         return None
     return tsums