# TCore Python API 行情与交易查询函数

## QueryAllInstrumentInfo

查询指定类型合约列表

{% tabs %}
{% tab title="Request" %}

```python
 def QueryAllInstrumentInfo(type):
```

| **Parameters** |                                 |
| -------------- | ------------------------------- |
| type           | 期货：Future  期权：Options  证券：Stock |
| {% endtab %}   |                                 |

{% tab title="Return" %}
返回[全部合约列表](https://algomaster.gitbook.io/tcore-api/hang-qing-can-shu-yu-hui-fu#quan-bu-he-yue-lie-biao-hui-fu)
{% endtab %}
{% endtabs %}

## QueryInstrumentInfo

查询指定合约信息

{% tabs %}
{% tab title="Request" %}

```python
def QueryInstrumentInfo(symbol):
```

| **Parameters** |      |
| -------------- | ---- |
| symbol         | 合约代码 |
| {% endtab %}   |      |

{% tab title="Return" %}
[返回合约资讯](https://algomaster.gitbook.io/tcore-api/hang-qing-can-shu-yu-hui-fu#he-yue-zi-xun-hui-fu)
{% endtab %}
{% endtabs %}

## SubHistory

回补历史

{% tabs %}
{% tab title="Request" %}

```python
def SubHistory(symbol, type, startTime, endTime):
```

| **Parameters** |                                                                   |
| -------------- | ----------------------------------------------------------------- |
| symbol         | 合约代码                                                              |
| type           | TICKS:历史ticks、1K:历史1K、DK:历史日K、DOGSS:历史Greeks秒数据、DOGSK:历史Greeks分数据 |
| startTime      | 回补起始时间                                                            |
| endTime        | 回补结束时间                                                            |
| {% endtab %}   |                                                                   |

{% tab title="Response" %}
[回补历史资料](https://algomaster.gitbook.io/tcore-api/python/can-shu-shuo-ming#hui-bu-li-shi-zi-liao-hui-fu)回覆为Json格式。
{% endtab %}
{% endtabs %}

## QryAccount

查询已登入资金账户

{% tabs %}
{% tab title="Request" %}

```python
def QryAccount():
```

{% endtab %}

{% tab title="Return" %}
[返回交易帐号资料](https://algomaster.gitbook.io/tcore-api/jiao-yi-can-shu-yu-hui-fu#jiao-yi-zhang-hao-zi-liao-hui-fu)
{% endtab %}
{% endtabs %}

## QryReport

查询当日委托回报

{% tabs %}
{% tab title="Request" %}

```python
 def QryReport(qryIndex=""):
```

| **Parameters** |              |
| -------------- | ------------ |
| qyIndex        | 取得资料，从第几笔开始。 |
| {% endtab %}   |              |

{% tab title="Return" %}
返回[回报回补资料](https://algomaster.gitbook.io/tcore-api/jiao-yi-can-shu-yu-hui-fu#xia-dan-can-shu)
{% endtab %}
{% endtabs %}

## QryFillReport

查询当日成交回报

{% tabs %}
{% tab title="Request" %}

```python
def QryFillReport(qryIndex=""):
```

| **Parameters** |              |
| -------------- | ------------ |
| qryIndex       | 取得资料，从第几笔开始。 |
| {% endtab %}   |              |

{% tab title="Return" %}
[成交回报栏位资料同](https://algomaster.gitbook.io/tcore-api/jiao-yi-can-shu-yu-hui-fu#cheng-jiao-hui-bu-zi-liao)
{% endtab %}
{% endtabs %}

## QryMargin

资金查询

{% tabs %}
{% tab title="Request" %}

```python
def QryMargin(BrkAcct):
```

| **Parameters** |                       |
| -------------- | --------------------- |
| SessionKey     | connect时回传的sessionkey |
| BrkAcct        | BrokerID-Account      |
| {% endtab %}   |                       |

{% tab title="Return" %}
[返回资金帐务](https://algomaster.gitbook.io/tcore-api/jiao-yi-can-shu-yu-hui-fu#zi-jin-zhang-wu-hui-fu)
{% endtab %}
{% endtabs %}

## QryPosition

部位查询

{% tabs %}
{% tab title="Request" %}

```python
def QryPosition(BrkAcct,QryIndex):
```

| **Parameters** |                  |
| -------------- | ---------------- |
| BrkAcct        | BrokerID-Account |
| QryIndex       | 取得资料，从第几笔开始。     |
| {% endtab %}   |                  |

{% tab title="Return" %}
[返回部位帳務](https://algomaster.gitbook.io/tcore-api/jiao-yi-can-shu-yu-hui-fu#bu-wei-zhang-wu-hui-fu)
{% endtab %}
{% endtabs %}

## QryPositionTracker

查询持仓监控

{% tabs %}
{% tab title="Request" %}

```python
def QryPositionTracker():
```

{% endtab %}

{% tab title="Return" %}
[返回持仓监控帳務](https://algomaster.gitbook.io/tcore-api/jiao-yi-can-shu-yu-hui-fu#chi-cang-jian-kong)
{% endtab %}
{% endtabs %}

## QryOptCombOrder

查询组合回报

```python
def QueryOptCombOrder(AM,qryIndex):
```

## OptComb

组合指令

```python
def OptComb(Param):
```
