> ## Documentation Index
> Fetch the complete documentation index at: https://systematica.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Trades

> systematica.tools.schedulers.trades

## `TradeScheduler`

```python theme={null}
TradeScheduler(
    template: str,
    loader_cls: vectorbtpro.data.base.Data,
    loader_params: Dict[str, Any],
    model_cls: Any,
    all_params: Dict[str, Any],
    bfc_schema_kwargs: Dict[str, Any] = _Nothing.NOTHING,
    messenger: systematica.tools.messengers.base.BaseMessenger = None,
    max_buffer: int = 120,
    trading_url: str = 'https://pm-vpc.bfcdev.com/api/trade-signal',
    logger: systematica.generic.loggers.Logger = None,
)
```

Workflow for managing strategy execution and data updates.

Method generated by attrs for class TradeScheduler.

### Ancestors

* `systematica.tools.schedulers.base.BaseScheduler`
* `abc.ABC`

### Class variables

* `template: str`: Template name.

* `loader_cls: vectorbtpro.data.base.Data`: Loader class.

* `loader_params: Dict[str, Any]`: Loader parameters.

* `model_cls: Any`: Model strategy.

* `all_params: Dict[str, Any]`: Model Parameters.

* `bfc_schema_kwargs: Dict[str, Any]`: Additional BFC schema parameters.

* `messenger: systematica.tools.messengers.base.BaseMessenger`: Custom messenger. Defaults to None.

* `max_buffer: int`: Maximum buffer in seconds. If the last data point is older than the buffer, the data is considered outdated.

* `trading_url: str`: Trading url.

* `logger: systematica.generic.loggers.Logger`: Custom logger.

### Instance variables

* `timestamp: pandas._libs.tslibs.timestamps.Timestamp`: Get the next timestamp.

### Methods

#### `check_data`

```python theme={null}
check_data(
    self,
    data: vectorbtpro.data.base.Data,
) ‑> Tuple[vectorbtpro.data.base.Data, bool]
```

Check data update.

**Parameters**:

| Name   | Type       | Default | Description    |
| ------ | ---------- | ------- | -------------- |
| `data` | `vbt.Data` | `--`    | Data instance. |

**Returns**:

| Type                | Description                           |
| ------------------- | ------------------------------------- |
| `data : vbt.Data`   | Updated data instance.                |
| `is_updated : bool` | Flag to check in line with timestamp. |

#### `execute`

```python theme={null}
execute(
    self,
)
```

Posts a trading signal to the server.

This method updates the data, runs the pipeline, and generates trade
signals. It then checks if the latest row in any of the entry or exit
signals has any True values. Finally, it posts generated signals to
the server.
