Skip to content

Commit 0978284

Browse files
committed
DOC: Warn that sell(size=frac) doesn't close buy(size=frac)
1 parent f0e12c6 commit 0978284

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backtesting/backtesting.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ def sell(self, *,
254254
Place a new short order and return it. For explanation of parameters, see `Order`
255255
and its properties.
256256
257+
.. caution::
258+
Keep in mind that `self.sell(size=.1)` doesn't close existing `self.buy(size=.1)`
259+
trade unless the underlying asset price hasn't changed yet.
260+
Use `Trade.close()` or `Position.close()` to exit trades.
261+
257262
See also `Strategy.buy()`.
258263
259264
.. note::

0 commit comments

Comments
 (0)