2024-11-15 21:13:19 +01:00
|
|
|
# TradesManager
|
|
|
|
|
|
|
|
|
|
## Table of Contents
|
|
|
|
|
- [trades_manager](#trades_manager.trades_manager)
|
|
|
|
|
- [TradesManager](#trades_manager.trades_manager)
|
|
|
|
|
- [update](#trades_manager.trade_manager.update)
|
|
|
|
|
- [values](#trades_manager.trade_manager.values)
|
|
|
|
|
- [keys](#trades_manager.trade_manager.keys)
|
|
|
|
|
- [items](#trades_manager.trade_manager.items)
|
|
|
|
|
- [to_dict](#trades_manager.trade_manager.to_dict)
|
|
|
|
|
- [PositionsManager](#trades_manager.positions_manager)
|
|
|
|
|
- [\__init\__](#positions_manager.__init__)
|
|
|
|
|
- [margin](#positions_manager.margin)
|
|
|
|
|
- [close](#positions_manager.close)
|
|
|
|
|
- [get_margin](#positions_manager.get_margin)
|
|
|
|
|
- [delete_margin](#positions_manager.delete_margin)
|
|
|
|
|
- [set_margin](#positions_manager.set_margin)
|
|
|
|
|
- [positions_get](#positions_manager.positions_get)
|
|
|
|
|
- [positions_total](#positions_manager.positions_total)
|
|
|
|
|
- [open_positions](#positions_manager.open_positions)
|
|
|
|
|
- [OrdersManager](#trades_manager.orders_manager)
|
|
|
|
|
- [get_orders_range](#orders_manager.get_orders_range)
|
|
|
|
|
- [history_orders_get](#orders_manager.history_orders_get)
|
|
|
|
|
- [history_orders_total](#orders_manager.history_orders_total)
|
|
|
|
|
- [DealsManager](#trades_manager.deals_manager)
|
|
|
|
|
- [get_deals_range](#deals_manager.get_deals_range)
|
|
|
|
|
- [history_deals_get](#deals_manager.history_deals_get)
|
|
|
|
|
- [history_deals_total](#deals_manager.history_deals_total)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="trades_manager.trades_manager"></a>
|
|
|
|
|
### TradesManager
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
class TradeManager(Generic[TradeData])
|
|
|
|
|
```
|
|
|
|
|
A generic class to manage trades data during a backtest. It is the parent class of the
|
|
|
|
|
PositionsManager, OrdersManager, and DealsManager. It implements some dict-like methods to manage the data.
|
|
|
|
|
It has a private attribute _data to store the data. It exposes the data through the values, keys, and items methods.
|
2024-11-15 21:13:19 +01:00
|
|
|
It also has a `to_dict` method to convert the data to a dictionary.
|
2024-11-13 04:29:37 +01:00
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|---------|------------------------|------------------------------|
|
|
|
|
|
| `_data` | `dict[int, TradeData]` | The data to store the trades |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Examples:
|
|
|
|
|
```python
|
|
|
|
|
>>> manager = TradeManager()
|
|
|
|
|
>>> manager[123456] = TradePosition(ticket=123456, symbol="EURUSD", volume=0.1)
|
|
|
|
|
>>> manager.update(ticket=123456, symbol="EURUSD", volume=0.1)
|
|
|
|
|
>>> manager[123456]
|
|
|
|
|
TradePosition(ticket=123456, symbol='EURUSD', volume=0.1)
|
|
|
|
|
>>> manager.values()
|
|
|
|
|
(TradePosition(ticket=123456, symbol='EURUSD', volume=0.1),)
|
|
|
|
|
>>> manager.keys()
|
|
|
|
|
(123456,)
|
|
|
|
|
>>> manager.items()
|
|
|
|
|
((123456, TradePosition(ticket=123456, symbol='EURUSD', volume=0.1)),)
|
|
|
|
|
>>> manager.to_dict()
|
|
|
|
|
{'123456' - {'ticket': 123456, 'symbol': 'EURUSD', 'volume': 0.1}}
|
|
|
|
|
>>> pos = manager.get(123456)
|
|
|
|
|
>>> pos
|
|
|
|
|
TradePosition(ticket=123456, symbol='EURUSD', volume=0.1)
|
|
|
|
|
>>> pos in manager
|
|
|
|
|
True
|
|
|
|
|
>>> len(manager)
|
|
|
|
|
1
|
|
|
|
|
>>> pos in manager
|
|
|
|
|
False
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<a id="trades_manager.update"></a>
|
2024-11-13 04:29:37 +01:00
|
|
|
#### update
|
|
|
|
|
```python
|
|
|
|
|
def update(*, ticket: int, **kwargs)
|
|
|
|
|
```
|
|
|
|
|
Update the data of a trade. Given the ticket of the trade and the new data to update.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|------------|-------|------------------------------------|
|
|
|
|
|
| `ticket` | `int` | The ticket of the trade to update. |
|
|
|
|
|
| `**kwargs` | | The new data to update. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="trades_manager.values"></a>
|
|
|
|
|
### values
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def values() -> tuple[TradeData, ...]
|
|
|
|
|
```
|
|
|
|
|
Returns the values of the data.
|
|
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="trades_manager.keys"></a>
|
|
|
|
|
### keys
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def keys() -> tuple[int, ...]
|
|
|
|
|
```
|
|
|
|
|
Returns the keys of the data.
|
|
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="trades_manager.items"></a>
|
|
|
|
|
### items
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def items() -> tuple[tuple[int, TradeData], ...]
|
|
|
|
|
```
|
|
|
|
|
Returns the items of the data.
|
|
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="trades_manager.to_dict"></a>
|
|
|
|
|
### to_dict
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def to_dict()
|
|
|
|
|
```
|
|
|
|
|
Convert the data to a dictionary.
|
|
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="trades_manager.positions_manager"></a>
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
class PositionsManager(TradeManager)
|
|
|
|
|
```
|
2024-11-15 21:13:19 +01:00
|
|
|
A class to manage the open positions during a backtest. It is a subclass of It has an additional
|
2024-11-13 04:29:37 +01:00
|
|
|
attribute _open_positions to store the open positions. It also has a margins attribute to store the margins of the
|
|
|
|
|
open positions. It overrides some methods of the TradeManager class to manage the open positions.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Attributes:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------|
|
|
|
|
|
| `data` | `dict` | The data to store the trades. This used for continuation of the backtesting, if it was stopped with some open positions. |
|
|
|
|
|
| `open_positions` | `set[int]` | The open positions. |
|
|
|
|
|
| `margins` | `dict[int, float]` | The margins of the open positions. |
|
|
|
|
|
|
2024-11-13 04:29:37 +01:00
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="positions_manager.__init__"></a>
|
|
|
|
|
#### \__init\__
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
2024-11-15 21:13:19 +01:00
|
|
|
def __init__(*, data: dict = None, open_positions: set[int] = None, margins: dict = None)
|
2024-11-13 04:29:37 +01:00
|
|
|
```
|
2024-11-15 21:13:19 +01:00
|
|
|
Positions manager manages the open positions during a backtest. It is a subclass of It has an
|
2024-11-13 04:29:37 +01:00
|
|
|
additional attribute _open_positions to store the open positions. It also has a margins attribute to store the
|
|
|
|
|
margins of the open positions. It overrides some methods of the TradeManager class to manage the open positions.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------|
|
|
|
|
|
| `data` | `dict` | The data to store the trades. This used for continuation of the backtesting, if it was stopped with some open positions. |
|
|
|
|
|
| `open_positions` | `set[int]` | The open positions. |
|
|
|
|
|
| `margins` | `dict[int, float]` | The margins of the open positions. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="positions_manager.margin"></a>
|
|
|
|
|
### margin
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
@property
|
|
|
|
|
def margin()
|
|
|
|
|
```
|
|
|
|
|
Returns the total margin of all open positions
|
|
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="positions_manager.close"></a>
|
|
|
|
|
### close
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def close(*, ticket: int) -> bool
|
|
|
|
|
```
|
|
|
|
|
Close a position. Given the ticket of the position to close.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|----------|-------|--------------------------------------|
|
|
|
|
|
| `ticket` | `int` | The ticket of the position to close. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="positions_manager.get_margin"></a>
|
|
|
|
|
#### get_margin
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def get_margin(*, ticket: int) -> float
|
|
|
|
|
```
|
|
|
|
|
Get the margin of a position. Given the ticket of the position.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|----------|-------|-----------------------------|
|
|
|
|
|
| `ticket` | `int` | The ticket of the position. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Returns:
|
|
|
|
|
| Type | Description |
|
|
|
|
|
|---------|-----------------------------|
|
|
|
|
|
| `float` | The margin of the position. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="positions_manager.delete_margin"></a>
|
|
|
|
|
### delete_margin
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def delete_margin(*, ticket: int)
|
|
|
|
|
```
|
|
|
|
|
Delete the margin of a position. Given the ticket of the position.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|----------|-------|-----------------------------|
|
|
|
|
|
| `ticket` | `int` | The ticket of the position. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="positions_manager.set_margin"></a>
|
|
|
|
|
### set_margin
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def set_margin(*, ticket: int, margin: float)
|
|
|
|
|
```
|
|
|
|
|
Set the margin of a position. Given the ticket of the position and the margin.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|----------|---------|-----------------------------|
|
|
|
|
|
| `ticket` | `int` | The ticket of the position. |
|
|
|
|
|
| `margin` | `float` | The margin of the position. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="positions_manager.positions_get"></a>
|
|
|
|
|
### positions_get
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
2024-11-15 21:13:19 +01:00
|
|
|
def positions_get(*, ticket: int = None, symbol: str = None, group: None = None) -> tuple[TradePosition, ...]
|
2024-11-13 04:29:37 +01:00
|
|
|
```
|
|
|
|
|
Get positions. Given the ticket, symbol, or group of the positions.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|----------|-------|-----------------------------|
|
|
|
|
|
| `ticket` | `int` | The ticket of the position. |
|
|
|
|
|
| `symbol` | `str` | The symbol of the position. |
|
|
|
|
|
| `group` | `str` | The group of the position. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Returns:
|
|
|
|
|
| Type | Description |
|
|
|
|
|
|------------------------|-----------------------------|
|
|
|
|
|
| `tuple[TradePosition]` | The positions. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Returns:
|
|
|
|
|
| Type | Description |
|
|
|
|
|
|-----------------------------|-----------------------------|
|
|
|
|
|
| `tuple[TradePosition, ...]` | The positions. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="positions_manager.positions_total"></a>
|
|
|
|
|
### positions_total
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def positions_total() -> int
|
|
|
|
|
```
|
|
|
|
|
Get the total number of open positions.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Returns:
|
|
|
|
|
| Type | Description |
|
|
|
|
|
|-------|-------------------------------------|
|
|
|
|
|
| `int` | The total number of open positions. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="positions_manager.open_positions"></a>
|
|
|
|
|
#### open_positions
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
@property
|
|
|
|
|
def open_positions() -> tuple[TradePosition, ...]
|
|
|
|
|
```
|
|
|
|
|
Returns the open positions.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|----------|-------|-----------------------------|
|
|
|
|
|
| `ticket` | `int` | The ticket of the position. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="trades_manager.orders_manager"></a>
|
|
|
|
|
### OrdersManager
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
class OrdersManager(TradeManager)
|
|
|
|
|
```
|
2024-11-15 21:13:19 +01:00
|
|
|
Managers orders data during a backtest. It is a subclass of It manages access to the historical
|
2024-11-13 04:29:37 +01:00
|
|
|
orders data
|
|
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="orders_manager.get_orders_range"></a>
|
|
|
|
|
#### get_orders_range
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
2024-11-15 21:13:19 +01:00
|
|
|
def get_orders_range(*, date_from: float, date_to: float) -> tuple[TradeData, ...]
|
2024-11-13 04:29:37 +01:00
|
|
|
```
|
|
|
|
|
Get orders within a date range. Given the start and end date of the range.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|-------------|---------|------------------------------|
|
|
|
|
|
| `date_from` | `float` | The start date of the range. |
|
|
|
|
|
| `date_to` | `float` | The end date of the range. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Returns:
|
|
|
|
|
| Type | Description |
|
|
|
|
|
|--------------------|-----------------------------------|
|
|
|
|
|
| `tuple[TradeData]` | The orders within the date range. |
|
|
|
|
|
|
2024-11-13 04:29:37 +01:00
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Returns:
|
|
|
|
|
| Type | Description |
|
|
|
|
|
|--------------------|-----------------------------------|
|
|
|
|
|
| `tuple[TradeData]` | The orders within the date range. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="orders_manager.history_orders_get"></a>
|
|
|
|
|
#### history_orders_get
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
2024-11-15 21:13:19 +01:00
|
|
|
def history_orders_get(*, date_from: float | datetime = None, date_to: float | datetime = None,
|
|
|
|
|
group: str = "", ticket: int = None, position: int = None) -> tuple[TradeOrder, ...]
|
2024-11-13 04:29:37 +01:00
|
|
|
```
|
|
|
|
|
Get historical orders. Given the start and end date of the range, the group, ticket, or position of the
|
|
|
|
|
orders.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|-------------|---------|------------------------------|
|
|
|
|
|
| `date_from` | `float` | The start date of the range. |
|
|
|
|
|
| `date_to` | `float` | The end date of the range. |
|
|
|
|
|
| `group` | `str` | The group of the orders. |
|
|
|
|
|
| `ticket` | `int` | The ticket of the order. |
|
|
|
|
|
| `position` | `int` | The position of the order. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Returns:
|
|
|
|
|
| Type | Description |
|
|
|
|
|
|---------------------|------------------------|
|
|
|
|
|
| `tuple[TradeOrder]` | The historical orders. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="orders_manager.history_orders_total"></a>
|
|
|
|
|
### history_orders_total
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def history_orders_total(*, date_from: datetime | float,
|
|
|
|
|
date_to: datetime | float) -> int
|
|
|
|
|
```
|
|
|
|
|
Get the total number of historical orders. Given the start and end date of the range.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|-------------|---------|------------------------------|
|
|
|
|
|
| `date_from` | `float` | The start date of the range. |
|
|
|
|
|
| `date_to` | `float` | The end date of the range. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="trades_manager.deals_manager"></a>
|
|
|
|
|
### DealsManager
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
class DealsManager(TradeManager)
|
|
|
|
|
```
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="deals_manager.get_deals_range"></a>
|
|
|
|
|
#### get_deals_range
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
2024-11-15 21:13:19 +01:00
|
|
|
def get_deals_range(*, date_from: float, date_to: float) -> tuple[TradeData, ...]
|
2024-11-13 04:29:37 +01:00
|
|
|
```
|
|
|
|
|
Get deals within a date range. Given the start and end date of the range.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|-------------|---------|------------------------------|
|
|
|
|
|
| `date_from` | `float` | The start date of the range. |
|
|
|
|
|
| `date_to` | `float` | The end date of the range. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Returns:
|
|
|
|
|
| Type | Description |
|
|
|
|
|
|--------------------|-----------------------------------|
|
|
|
|
|
| `tuple[TradeData]` | The deals within the date range. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="deals_manager.history_deals_get"></a>
|
|
|
|
|
### history_deals_get
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def history_deals_get(*,
|
|
|
|
|
date_from: float | datetime = None,
|
|
|
|
|
date_to: float | datetime = None,
|
|
|
|
|
group: str = "",
|
|
|
|
|
ticket: int = None,
|
|
|
|
|
position: int = None) -> tuple[TradeDeal, ...]
|
|
|
|
|
```
|
|
|
|
|
History deals get. Given the start and end date of the range, the group, ticket, or position of the deals.
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|-------------|---------|------------------------------|
|
|
|
|
|
| `date_from` | `float` | The start date of the range. |
|
|
|
|
|
| `date_to` | `float` | The end date of the range. |
|
|
|
|
|
| `group` | `str` | The group of the deals. |
|
|
|
|
|
| `ticket` | `int` | The ticket of the deal. |
|
|
|
|
|
| `position` | `int` | The position of the deal. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
<a id="deals_manager.history_deals_total"></a>
|
|
|
|
|
#### history_deals_total
|
2024-11-13 04:29:37 +01:00
|
|
|
```python
|
|
|
|
|
def history_deals_total(*, date_from: datetime | float,
|
|
|
|
|
date_to: datetime | float) -> int
|
|
|
|
|
```
|
|
|
|
|
Get the total number of historical deals. Given the start and end date of the range
|
|
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Parameters:
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|-------------|---------|------------------------------|
|
|
|
|
|
| `date_from` | `float` | The start date of the range. |
|
|
|
|
|
| `date_to` | `float` | The end date of the range. |
|
2024-11-13 04:29:37 +01:00
|
|
|
|
2024-11-15 21:13:19 +01:00
|
|
|
#### Returns:
|
|
|
|
|
| Type | Description |
|
|
|
|
|
|-------|---------------------------------------|
|
|
|
|
|
| `int` | The total number of historical deals. |
|