#NEWLINE# def resampleBarFeed( self , frequency , callback ) : #NEWLINE# #INDENT# '\n        Builds a resampled barfeed that groups bars by a certain frequency.\n\n        :param frequency: The grouping frequency in seconds. Must be > 0.\n        :param callback: A function similar to onBars that will be called when new bars are available.\n        :rtype: :class:`pyalgotrade.barfeed.BaseBarFeed`.\n        ' #NEWLINE# ret = resampled . ResampledBarFeed ( self . getFeed ( ) , callback ) #NEWLINE# ret . getNewValuesEvent ( ) . subscribe ( callback ) #NEWLINE# self . getDispatcher ( ) . addSubject ( ret ) #NEWLINE# self . __resampledBarFeeds . append ( ret ) #NEWLINE# return ret