---
title: 'max-qty'
sidebar_label: 'max-qty'
sidebar_position: 3
---

# longbridge max-qty

根据当前账户余额和指定价格，估算最大可买入或卖出数量。

## 基本用法

```bash
longbridge max-qty TSLA.US --side buy --price 340.00
```

```
| Field          | Value   |
|----------------|---------|
| Symbol         | TSLA.US |
| Cash Max Qty   | 0       |
| Margin Max Qty | 896     |
```

## 示例

### 查询指定价格下的最大买入数量

```bash
longbridge max-qty TSLA.US --side buy --price 340.00
# JSON 输出，适合脚本使用
longbridge max-qty TSLA.US --side buy --price 340.00 --format json
```

返回按给定价格可买入的最大股数，分别按现金和融资购买力拆分显示。

### 查询最大卖出数量

```bash
longbridge max-qty TSLA.US --side sell
```

根据当前持仓返回最大可卖出股数。

## 权限要求

查询最大可委托数量需要 OAuth 交易或账户权限。详见 [交易权限](/zh-CN/docs/trade/) 设置说明。
