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

Open orders do not close in the liquidation event #210

Closed
farukuzun opened this issue Jun 27, 2021 · 1 comment
Closed

Open orders do not close in the liquidation event #210

farukuzun opened this issue Jun 27, 2021 · 1 comment
Labels
bug Something isn't working stale No recent activity.

Comments

@farukuzun
Copy link

Open orders do not close in the liquidation event. Creates the following error:

============================== EXCEPTION TRACEBACK:
  File "/jesse_strategy/venv/bin/jesse", line 8, in <module>
    sys.exit(cli())
  File "/jesse_strategy/venv/lib/python3.9/site-packages/click/core.py", line 1134, in __call__
    return self.main(*args, **kwargs)
  File "/jesse_strategy/venv/lib/python3.9/site-packages/click/core.py", line 1059, in main
    rv = self.invoke(ctx)
  File "/jesse_strategy/venv/lib/python3.9/site-packages/click/core.py", line 1665, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/jesse_strategy/venv/lib/python3.9/site-packages/click/core.py", line 1401, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/jesse_strategy/venv/lib/python3.9/site-packages/click/core.py", line 767, in invoke
    return __callback(*args, **kwargs)
  File "/jesse_strategy/venv/lib/python3.9/site-packages/jesse/__init__.py", line 302, in backtest
    backtest_mode.run(start_date, finish_date, chart=chart, tradingview=tradingview, csv=csv,
  File "/jesse_strategy/venv/lib/python3.9/site-packages/jesse/modes/backtest_mode/__init__.py", line 66, in run
    simulator(candles)
  File "/jesse_strategy/venv/lib/python3.9/site-packages/jesse/modes/backtest_mode/__init__.py", line 274, in simulator
    _simulate_price_change_effect(short_candle, exchange, symbol)
  File "/jesse_strategy/venv/lib/python3.9/site-packages/jesse/modes/backtest_mode/__init__.py", line 378, in _simulate_price_change_effect
    order.execute()
  File "/jesse_strategy/venv/lib/python3.9/site-packages/jesse/models/Order.py", line 148, in execute
    p._on_executed_order(self)
  File "/jesse_strategy/venv/lib/python3.9/site-packages/jesse/models/Position.py", line 353, in _on_executed_order
    self.strategy._on_updated_position(order)
  File "/jesse_strategy/venv/lib/python3.9/site-packages/jesse/strategies/Strategy.py", line 142, in _on_updated_position
    self._log_position_update(order, role)
  File "/jesse_strategy/venv/lib/python3.9/site-packages/jesse/strategies/Strategy.py", line 1078, in _log_position_update
    self.trade.orders.append(order)
=========================================================================

 Uncaught Exception: AttributeError: 'NoneType' object has no attribute 'orders'
@farukuzun farukuzun added the bug Something isn't working label Jun 27, 2021
farukuzun added a commit to farukuzun/jesse that referenced this issue Jun 27, 2021
farukuzun added a commit to farukuzun/jesse that referenced this issue Jun 27, 2021
@stale
Copy link

stale bot commented Dec 5, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale No recent activity. label Dec 5, 2021
@stale stale bot closed this as completed Dec 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale No recent activity.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant