8000 Added more information for a orderbook by Unt3r · Pull Request #136 · Qluxzz/avanza · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added more information for a orderbook #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions avanza/avanza.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,13 @@ def get_order_books(self, order_book_ids: Sequence[str]) -> List[OrderBook]:
HttpMethod.GET,
Route.ORDERBOOK_LIST_PATH.value.format(",".join(order_book_ids)),
)

def get_orderbook(self, order_book_id: str ):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally this might be a question for @Qluxzz, do we want to name it get_orderbook or get_order_book

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since order book is two words it should be get_order_book

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_orderbook(self, order_book_id: str ):
def get_orderbook(self, order_book_id: str):

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please consider adding return type as in other functions e.g. -> List[OrderBook]:

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You (@Unt3r) mentioned that among other things the tick size is also returned. Does the other things in the response correspond to the existing Orderbook model?

Easiest way to validate that is to write a test for the method, it will then say what fields (if any) are missing or has invalid values.


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a function description? Similar to on line 448

return self.__call(
HttpMethod.GET,
Route.ORDERBOOK_PATH.value.format(order_book_id)
)

def get_insights_report(
self, account_id: str, time_period: InsightsReportTimePeriod
Expand Down
1 change: 1 addition & 0 deletions avanza/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class Route(enum.Enum):
ORDER_PLACE_PATH_BUY_FUND = "/_api/fund-guide/fund-order-page/buy"
ORDER_PLACE_PATH_SELL_FUND = "/_api/fund-guide/fund-order-page/sell"
ORDER_EDIT_PATH = "/_api/trading-critical/rest/order/modify"
ORDERBOOK_PATH = '/_api/trading-critical/rest/orderbook/{}'
ORDERBOOK_LIST_PATH = "/_mobile/market/orderbooklist/{}"
PRICE_ALERT_PATH = "/_cqbe/marketing/service/alert/{}"
STOP_LOSS_PATH = "/_api/trading/stoploss"
Expand Down
0