Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions avanza/avanza.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,27 @@ def get_all_stop_losses(self):
"""
return self.__call(HttpMethod.GET, Route.STOP_LOSS_PATH.value)

def delete_stop_loss_order(self, account_id: str, stop_loss_id: str):
"""delete a stop loss order

Args:

stop_loss_id: The id of the stop loss order to delete.

account_id: A valid account id.

Returns:
Nothing
"""

return self.__call(
HttpMethod.DELETE,
Route.ORDER_DELETE_STOP_LOSS_PATH.value.format(
account_id,
stop_loss_id,
),
)

def delete_order(self, account_id: str, order_id: str):
"""Delete an existing order

Expand Down
1 change: 1 addition & 0 deletions avanza/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class Route(enum.Enum):
MONTHLY_SAVINGS_RESUME_PATH = "/_api/transfer/monthly-savings/{}/{}/resume"
NOTE_PATH = "/_api/contract-notes/documents/{}/{}/note.pdf"
ORDER_DELETE_PATH = "/_api/trading-critical/rest/order/delete"
ORDER_DELETE_STOP_LOSS_PATH = "/_api/trading-critical/rest/stoploss/{}/{}"
ORDER_GET_PATH = "/_mobile/order/{}?accountId={}&orderId={}"
ORDER_PLACE_PATH = "/_api/trading-critical/rest/order/new"
ORDER_PLACE_STOP_LOSS_PATH = "/_api/trading-critical/rest/stoploss/new"
Expand Down