tbapi.api.interfaces.orders.istrategy_order_manager

 1from __future__ import annotations
 2from typing import TYPE_CHECKING
 3from tbapi.common.decorators import tb_interface
 4from tbapi.common.converters import to_python_datetime, to_net_datetime
 5from datetime import datetime
 6from Tickblaze.Scripts.Api.Interfaces.Orders import IStrategyOrderManager as _IStrategyOrderManager
 7from typing import Any, overload
 8from abc import ABC, abstractmethod
 9from tbapi.api.interfaces.orders.iorder_manager import IOrderManager
10
11@tb_interface(_IStrategyOrderManager)
12class IStrategyOrderManager(IOrderManager):
13
14
15    @abstractmethod
16    def flatten(self, comment: str = "") -> None:
17        """Closes positions and cancel pending orders.            Optional comment for the orders and cancellations.            Will also automatically flatten incoming fills appearing after the call      is made. This behavior is automatically disabled when a new entry is made."""
18        result = self._value.Flatten(comment)
19        return result
20  
21    @abstractmethod
22    def cancel_pending_orders(self, include_attached_orders: bool, comment: str = "") -> None:
23        """Cancels all pending orders            True if attached orders should be included      Comment to place on order"""
24        result = self._value.CancelPendingOrders(include_attached_orders, comment)
25        return result
26  
@tb_interface(_IStrategyOrderManager)
class IStrategyOrderManager(tbapi.api.interfaces.orders.iorder_manager.IOrderManager):
17@tb_interface(_IStrategyOrderManager)
18class IStrategyOrderManager(IOrderManager):
19
20
21    @abstractmethod
22    def flatten(self, comment: str = "") -> None:
23        """Closes positions and cancel pending orders.            Optional comment for the orders and cancellations.            Will also automatically flatten incoming fills appearing after the call      is made. This behavior is automatically disabled when a new entry is made."""
24        result = self._value.Flatten(comment)
25        return result
26  
27    @abstractmethod
28    def cancel_pending_orders(self, include_attached_orders: bool, comment: str = "") -> None:
29        """Cancels all pending orders            True if attached orders should be included      Comment to place on order"""
30        result = self._value.CancelPendingOrders(include_attached_orders, comment)
31        return result

Provides methods for managing orders and positions within the trading system.

IStrategyOrderManager(*args, **kwargs)
199        def __init__(self, *args, **kwargs):
200            pass
@abstractmethod
def flatten(self, comment: str = '') -> None:
21    @abstractmethod
22    def flatten(self, comment: str = "") -> None:
23        """Closes positions and cancel pending orders.            Optional comment for the orders and cancellations.            Will also automatically flatten incoming fills appearing after the call      is made. This behavior is automatically disabled when a new entry is made."""
24        result = self._value.Flatten(comment)
25        return result

Closes positions and cancel pending orders. Optional comment for the orders and cancellations. Will also automatically flatten incoming fills appearing after the call is made. This behavior is automatically disabled when a new entry is made.

@abstractmethod
def cancel_pending_orders(self, include_attached_orders: bool, comment: str = '') -> None:
27    @abstractmethod
28    def cancel_pending_orders(self, include_attached_orders: bool, comment: str = "") -> None:
29        """Cancels all pending orders            True if attached orders should be included      Comment to place on order"""
30        result = self._value.CancelPendingOrders(include_attached_orders, comment)
31        return result

Cancels all pending orders True if attached orders should be included Comment to place on order