unofficial_tabdeal_api.tabdeal_client ===================================== .. py:module:: unofficial_tabdeal_api.tabdeal_client .. autoapi-nested-parse:: This is the class of Tabdeal client. Classes ------- .. autoapisummary:: unofficial_tabdeal_api.tabdeal_client.TabdealClient Module Contents --------------- .. py:class:: TabdealClient(*, user_hash, authorization_key, _is_test = False) Bases: :py:obj:`unofficial_tabdeal_api.authorization.AuthorizationClass`, :py:obj:`unofficial_tabdeal_api.margin.MarginClass`, :py:obj:`unofficial_tabdeal_api.wallet.WalletClass`, :py:obj:`unofficial_tabdeal_api.order.OrderClass` a client class to communicate with Tabdeal platform. .. py:method:: _validate_trade_conditions(order) :async: Validate trade conditions for a margin order. :param order: The margin order to validate. :type order: MarginOrderModel :returns: True if the trade conditions are valid, False otherwise. :rtype: bool .. py:method:: _open_order(order) :async: Open a margin order. :param order: The margin order to open. :type order: MarginOrderModel :returns: None .. py:method:: _wait_for_order_fill(order) :async: Wait for the margin order to be filled. :param order: The margin order to wait for. :type order: MarginOrderModel :returns: True if the order is filled, False otherwise. :rtype: bool .. py:method:: _setup_stop_loss_take_profit(order) :async: Setup stop loss and take profit for a margin order. :param order: The margin order to setup SL/TP for. :type order: MarginOrderModel :returns: The margin asset ID. :rtype: int .. py:method:: _wait_for_order_close(margin_asset_id) :async: Wait for the margin order to close. :param margin_asset_id: The ID of the margin asset to wait for. :type margin_asset_id: int .. py:method:: _withdraw_balance_if_requested(order) :async: Withdraw balance from margin asset to wallet if requested. :param order: The margin order containing the asset symbol. :type order: MarginOrderModel .. py:method:: trade_margin_order(*, order, withdraw_balance_after_trade) :async: Trade a margin order. :param order: MarginOrderModel object containing order details. :type order: MarginOrderModel :param withdraw_balance_after_trade: Flag indicating whether to withdraw balance after trade. :type withdraw_balance_after_trade: bool :returns: Whether the trade was successful or not. :rtype: bool