Skip to content

Commit a4016e5

Browse files
committed
DOC: Mention Position.close() more prominently
1 parent eaf671e commit a4016e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

backtesting/backtesting.py

+6
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ def buy(self, *,
203203
"""
204204
Place a new long order. For explanation of parameters, see `Order` and its properties.
205205
206+
See `Position.close()` and `Trade.close()` for closing existing positions.
207+
206208
See also `Strategy.sell()`.
207209
"""
208210
assert 0 < size < 1 or round(size) == size, \
@@ -219,6 +221,10 @@ def sell(self, *,
219221
Place a new short order. For explanation of parameters, see `Order` and its properties.
220222
221223
See also `Strategy.buy()`.
224+
225+
.. note::
226+
If you merely want to close an existing long position,
227+
use `Position.close()` or `Trade.close()`.
222228
"""
223229
assert 0 < size < 1 or round(size) == size, \
224230
"size must be a positive fraction of equity, or a positive whole number of units"

0 commit comments

Comments
 (0)