tbapi.api.bases.itrade_management_strategy_script_base

 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.Bases import ITradeManagementStrategyScriptBase as _ITradeManagementStrategyScriptBase
 7from typing import Any, overload
 8from abc import ABC, abstractmethod
 9from tbapi.api.interfaces.orders.iorder_manager import IOrderManager
10
11@tb_interface(_ITradeManagementStrategyScriptBase)
12class ITradeManagementStrategyScriptBase(IOrderManager):
13    """Interface for a trade management strategy script base, providing methods to start and stop the strategy."""
14
15    @property
16    def is_active(self) -> bool:
17        """Indicates whether the strategy is currently active."""
18        val = self._value.IsActive
19        return val
20
21    @abstractmethod
22    def start(self) -> None:
23        """Starts the strategy."""
24        result = self._value.Start()
25        return result
26  
27    @abstractmethod
28    def stop(self) -> None:
29        """Stops the strategy."""
30        result = self._value.Stop()
31        return result
32  
@tb_interface(_ITradeManagementStrategyScriptBase)
class ITradeManagementStrategyScriptBase(tbapi.api.interfaces.orders.iorder_manager.IOrderManager):
17@tb_interface(_ITradeManagementStrategyScriptBase)
18class ITradeManagementStrategyScriptBase(IOrderManager):
19    """Interface for a trade management strategy script base, providing methods to start and stop the strategy."""
20
21    @property
22    def is_active(self) -> bool:
23        """Indicates whether the strategy is currently active."""
24        val = self._value.IsActive
25        return val
26
27    @abstractmethod
28    def start(self) -> None:
29        """Starts the strategy."""
30        result = self._value.Start()
31        return result
32  
33    @abstractmethod
34    def stop(self) -> None:
35        """Stops the strategy."""
36        result = self._value.Stop()
37        return result

Interface for a trade management strategy script base, providing methods to start and stop the strategy.

ITradeManagementStrategyScriptBase(*args, **kwargs)
199        def __init__(self, *args, **kwargs):
200            pass
is_active: bool
21    @property
22    def is_active(self) -> bool:
23        """Indicates whether the strategy is currently active."""
24        val = self._value.IsActive
25        return val

Indicates whether the strategy is currently active.

@abstractmethod
def start(self) -> None:
27    @abstractmethod
28    def start(self) -> None:
29        """Starts the strategy."""
30        result = self._value.Start()
31        return result

Starts the strategy.

@abstractmethod
def stop(self) -> None:
33    @abstractmethod
34    def stop(self) -> None:
35        """Stops the strategy."""
36        result = self._value.Stop()
37        return result

Stops the strategy.