ValueError: <MonthEnd> is a non-fixed frequency


#1

Hello,
I’m trying to run algorithm in paper-trading mode.
I got this error.

[2018-12-02 16:44:36.732749] INFO: run_algo: running algo in paper-trading mode
Traceback (most recent call last):
  File "example/momentum.py", line 253, in <module>
    capital_base=1000
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/utils/run_algo.py", line 643, in run_algorithm
    stats_output=stats_output
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/utils/run_algo.py", line 361, in _run
    overwrite_sim_params=False,
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/exchange/exchange_algorithm.py", line 1052, in run
    data, overwrite_sim_params
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/exchange/exchange_algorithm.py", line 360, in run
    data, overwrite_sim_params
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/algorithm.py", line 725, in run
    for perf in self.get_generator():
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/exchange/exchange_algorithm.py", line 658, in get_generator
    self._init_trading_client()
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/exchange/exchange_algorithm.py", line 651, in _init_trading_client
    benchmark_source=self._create_benchmark_source(),
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/algorithm.py", line 574, in _create_benchmark_source
    benchmark_returns=benchmark_returns,
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/sources/benchmark_source.py", line 49, in __init__
    self.data_portal
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/sources/benchmark_source.py", line 161, in _initialize_precalculated_series
    ffill=True
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/exchange/exchange_data_portal.py", line 97, in get_history_window
    ffill))
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/redo/__init__.py", line 165, in retry
    return action(*args, **kwargs)
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/exchange/exchange_data_portal.py", line 71, in _get_history_window
    ffill)
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/exchange/exchange_data_portal.py", line 220, in get_exchange_history_window
    False)
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/exchange/exchange.py", line 543, in get_history_window
    end_dt=forward_fill_till_dt)
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/exchange/utils/exchange_utils.py", line 793, in get_candles_df
    rounded_end_dt = end_dt.floor(freq)
  File "pandas/tslib.pyx", line 460, in pandas.tslib.Timestamp.floor (pandas/tslib.c:11368)
  File "pandas/tslib.pyx", line 424, in pandas.tslib.Timestamp._round (pandas/tslib.c:10794)
  File "/Users/seonggwanlee/git/catalyst/catalyst-venv/lib/python3.6/site-packages/pandas/tseries/offsets.py", line 512, in nanos
    raise ValueError("{0} is a non-fixed frequency".format(self))
ValueError: <MonthEnd> is a non-fixed frequency

And here is run_algorithm method setting I used

run_algorithm(
    analyze=analyze,
    initialize=initialize,
    handle_data=handle_data,
    exchange_name='binance',
    algo_namespace=NAMESPACE,
    quote_currency='usdt',
    live=True,
    simulate_orders=True,
    capital_base=1000
)

any help would be grateful. Thank you.


#2

Hi @sgwanlee,

I wasn’t able to reproduce your issue. Could you please elaborate more on the functions you are using in your algorithm?

Thanks,

Lena