MCPcopy Index your code
hub / github.com/kernc/backtesting.py / __repr__

Method __repr__

backtesting/backtesting.py:441–451  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

439 return self
440
441 def __repr__(self):
442 return '<Order {}>'.format(', '.join(f'{param}={try_(lambda: round(value, 5), value)!r}'
443 for param, value in (
444 ('size', self.__size),
445 ('limit', self.__limit_price),
446 ('stop', self.__stop_price),
447 ('sl', self.__sl_price),
448 ('tp', self.__tp_price),
449 ('contingent', self.is_contingent),
450 ('tag', self.__tag),
451 ) if value is not None)) # noqa: E126
452
453 def cancel(self):
454 """Cancel the order."""

Callers

nothing calls this directly

Calls 1

try_Function · 0.85

Tested by

no test coverage detected