Skip to content

Commit a05a8ce

Browse files
update docstring; update release.yaml
1 parent 9dc6518 commit a05a8ce

File tree

2 files changed

+46
-20
lines changed

2 files changed

+46
-20
lines changed

.github/release.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ changelog:
2727
- title: Other Changes
2828
labels:
2929
- "*"
30-
# exclude:
31-
# labels:
32-
# - dependencies
30+
exclude:
31+
labels:
32+
- dependencies
33+
- github_actions
3334
- title: 👒 Dependencies
3435
labels:
3536
- dependencies
37+
- github_actions

kraken/spot/trade.py

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -256,17 +256,31 @@ def create_order( # pylint: disable=too-many-branches,too-many-arguments # noqa
256256
3. When the price hits $27000 a limit order will be placed at
257257
$26800 to sell 1.2 BTC. This ensures that the asset will be
258258
sold for $26800 or better.
259-
''' >>> from kraken.spot import Trade >>> trade =
260-
Trade(key="api-key", secret="secret-key") >>> from datetime import
261-
datetime, timedelta, timezone >>> deadline = ( ...
262-
datetime.now(timezone.utc) + timedelta(seconds=20) ... ).isoformat()
263-
>>> trade.create_order( ... ordertype="stop-loss-limit", ...
264-
pair="XBTUSD", ... side="buy", ... volume=1.2, ...
265-
price=24000, ... price2=25000, ... validate=True, # just
266-
validate the input, do not place on the market ...
267-
trigger="last", ... timeinforce="GTC", ... leverage=4, ...
268-
deadline=deadline, ... close_ordertype="take-profit-limit", ...
269-
close_price=27000, ... close_price2=26800, ... ) {
259+
'''
260+
261+
>>> from kraken.spot import Trade
262+
>>> trade = Trade(key="api-key", secret="secret-key")
263+
>>> from datetime import datetime, timedelta, timezone
264+
>>> deadline = (
265+
... datetime.now(timezone.utc) + timedelta(seconds=20)
266+
... ).isoformat()
267+
>>> trade.create_order(
268+
... ordertype="stop-loss-limit",
269+
... pair="XBTUSD",
270+
... side="buy",
271+
... volume=1.2,
272+
... price=24000,
273+
... price2=25000,
274+
... validate=True, # just validate the input, do not place on the market
275+
... trigger="last",
276+
... timeinforce="GTC",
277+
... leverage=4,
278+
... deadline=deadline,
279+
... close_ordertype="take-profit-limit",
280+
... close_price=27000,
281+
... close_price2=26800,
282+
... )
283+
{
270284
'descr': {
271285
'order': 'buy 0.00100000 XBTUSD @ stop loss 24000.0 -> limit
272286
25000.0 with 2:1 leverage', 'close': 'close position @ take
@@ -282,12 +296,22 @@ def create_order( # pylint: disable=too-many-branches,too-many-arguments # noqa
282296
automatically
283297
* The the percentage sign "%" can be used to define relative
284298
changes.
285-
''' >>> trade.create_order( ... ordertype="stop-loss-limit", ...
286-
pair="XBTUSD", ... side="buy", ... volume=1.2, ...
287-
price=24000, ... price2="+1000", ... validate=True, ...
288-
trigger="last", ... timeinforce="GTC", ...
289-
close_ordertype="take-profit-limit", ... close_price=27000, ...
290-
close_price2="#2%", ... ) {
299+
'''
300+
>>> trade.create_order(
301+
... ordertype="stop-loss-limit",
302+
... pair="XBTUSD",
303+
... side="buy",
304+
... volume=1.2,
305+
... price=24000,
306+
... price2="+1000",
307+
... validate=True,
308+
... trigger="last",
309+
... timeinforce="GTC",
310+
... close_ordertype="take-profit-limit",
311+
... close_price=27000,
312+
... close_price2="#2%",
313+
... )
314+
{
291315
'descr': {
292316
'order': 'buy 0.00100000 XBTUSD @ stop loss 24000.0 -> limit
293317
+1000.0', 'close': 'close position @ take profit 27000.0 ->

0 commit comments

Comments
 (0)