Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registering an indicator for quotes results in an error #30

Closed
scoriiu opened this issue Sep 18, 2020 · 1 comment
Closed

Registering an indicator for quotes results in an error #30

scoriiu opened this issue Sep 18, 2020 · 1 comment

Comments

@scoriiu
Copy link
Contributor

scoriiu commented Sep 18, 2020

I'm not sure if registering an indicator for quotes should be supported or not, but currently it raises an error. If not supported, would be nice to have a condition in place that restricts registering the indicators for quotes.

 # Register the indicators for updating
        self.register_indicator_for_quote_ticks(
            symbol=self.symbol,
            indicator=self.sma)

Traceback (most recent call last):
  File "/Users/solo/git/nautilus_trader/backtest/backtest_market_maker.py", line 74, in <module>
    engine.run(start, stop)
  File "nautilus_trader/backtest/engine.pyx", line 195, in nautilus_trader.backtest.engine.BacktestEngine.run
  File "nautilus_trader/backtest/engine.pyx", line 282, in nautilus_trader.backtest.engine.BacktestEngine.run
  File "nautilus_trader/backtest/data.pyx", line 368, in nautilus_trader.backtest.data.BacktestDataClient.process_tick
  File "nautilus_trader/common/data.pyx", line 221, in nautilus_trader.common.data.DataClient.handle_quote_tick
  File "nautilus_trader/trading/strategy.pyx", line 463, in nautilus_trader.trading.strategy.TradingStrategy.handle_quote_tick
  File "nautilus_trader/trading/strategy.pyx", line 478, in nautilus_trader.trading.strategy.TradingStrategy.handle_quote_tick
  File "nautilus_trader/indicators/base/indicator.pyx", line 51, in nautilus_trader.indicators.base.indicator.Indicator.handle_quote_tick
TypeError: 'NotImplementedType' object is not callable
@cjdsellers
Copy link
Member

cjdsellers commented Sep 19, 2020

All MovingAverage type indicators now support registration for quote and trade ticks (on the develop branch). Note the optional parameter for price_type and specify MID, BID or ASK (applicable for quote ticks only).

Not all indicators support every data type for registration. Unfortunately PyCharm doesn't seem to detect an invalid class type in the registration method even if the base classes were changed to reflect the supported handling methods.

Your feedback is really appreciated. The API is in a state of flux at the moment, versioning has been moved back to beta again.

Please continue to let us know of any pain points, or any further suggestions you may have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants