<commit_before># -*- coding: utf-8 -*-

class Strategy(object):
    TIMEFRAMES = []  # e.g. ['M30', 'H2']

    def __init__(self, instrument):
        self.instrument = instrument
        if not self.TIMEFRAMES:
            raise ValueError('Please define TIMEFRAMES variable.')

    def start(self):
        """Called on strategy start."""
        raise NotImplementedError()

    def new_bar(self, instrument, cur_index):
        """Called on every bar of every instrument that client is subscribed on."""
        raise NotImplementedError()

    def execute(self, engine, instruments, cur_index):
        """Called on after all indicators have been updated for this bar's index"""
        raise NotImplementedError()

    def end(self, engine):
        """Called on strategy stop."""
        raise NotImplementedError()<commit_msg>Add default BUFFER_SIZE for feeds<commit_after># -*- coding: utf-8 -*-

from collections import deque

from logbook import Logger

log = Logger('pyFxTrader')


class Strategy(object):
    TIMEFRAMES = []  # e.g. ['M30', 'H2']
    BUFFER_SIZE = 500

    feeds = {}

    def __init__(self, instrument):
        self.instrument = instrument

        if not self.TIMEFRAMES:
            raise ValueError('Please define TIMEFRAMES variable.')

        for tf in self.TIMEFRAMES:
            self.feeds[tf] = deque(maxlen=self.BUFFER_SIZE)
            log.info('Initialized %s feed for %s' % (tf, self.instrument))

    def start(self):
        """Called on strategy start."""
        raise NotImplementedError()

    def new_bar(self, instrument, cur_index):
        """Called on every bar of every instrument that client is subscribed on."""
        raise NotImplementedError()

    def execute(self, engine, instruments, cur_index):
        """Called on after all indicators have been updated for this bar's index"""
        raise NotImplementedError()

    def end(self, engine):
        """Called on strategy stop."""
        raise NotImplementedError()
{'fraction_non_alphanumeric': 0.11127895266868076, 'fraction_numerical': 0.0055387713997985906, 'mean_word_length': 2.7992351816443595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6178221', 'n_tokens_mistral': 556, 'n_tokens_neox': 539, 'n_words': 181}