Ejemplo n.º 1
0
            return [np.nan, count]
        else:
            return [209, count]
    elif frequency == '1m':
        if count == 0:
            return [np.nan, count]
        else:
            return [count - 1, count]


MIXED_FREQUENCY_MINUTES = TradingEnvironment.instance().market_minute_window(
    to_utc('2013-07-03 9:31AM'),
    600,
)
DAILY_OPEN_CLOSE_SPECS = [
    HistorySpec(3, '1d', 'open_price', False),
    HistorySpec(3, '1d', 'close_price', False),
]
ILLIQUID_PRICES_SPECS = [
    HistorySpec(3, '1m', 'price', False),
    HistorySpec(5, '1m', 'price', True),
]
MIXED_FREQUENCY_SPECS = [
    HistorySpec(1, '1m', 'price', False),
    HistorySpec(2, '1m', 'price', False),
    HistorySpec(2, '1d', 'price', False),
]
MIXED_FIELDS_SPECS = [
    HistorySpec(3, '1m', 'price', True),
    HistorySpec(3, '1m', 'open_price', True),
    HistorySpec(3, '1m', 'close_price', True),
Ejemplo n.º 2
0
            return [np.nan, count]
        else:
            return [209, count]
    elif frequency == '1m':
        if count == 0:
            return [np.nan, count]
        else:
            return [count - 1, count]


MIXED_FREQUENCY_MINUTES = _cases_env.market_minute_window(
    to_utc('2013-07-03 9:31AM'),
    600,
)
ONE_MINUTE_PRICE_ONLY_SPECS = [
    HistorySpec(1, '1m', 'price', True, _cases_env, data_frequency='minute'),
]
DAILY_OPEN_CLOSE_SPECS = [
    HistorySpec(3,
                '1d',
                'open_price',
                False,
                _cases_env,
                data_frequency='minute'),
    HistorySpec(3,
                '1d',
                'close_price',
                False,
                _cases_env,
                data_frequency='minute'),
]